PDA

View Full Version : Think with me ;D



RyanS
18-09-2006, 04:14 PM
Well basically i will be making a chat.

I was thinking that on the submit message bit too mute the room i could do something like this:



<?
if($_POST['message'] == ':room_shutup'){
$update=mysql_query(UPDATE `chat` set `mute` '1'))
}else{
Add chat message here.
?>


obviously the code above is not right right at all but you should understand that if you type :room_shutup it sets mute in the mysql to 1 which would mean no one called talk.

But i was wondering how i could type like :mute_USERNAME and make it set the mysql update in there name bit to 1 on mute so they cant talk.

Thanks, if you understand!

YouFail
18-09-2006, 04:36 PM
I understand what your saying. Im sure it would be the same as for example styling a username colour depending on the level. Im not 100% sure if you could edit the SQL from outside your program.

I highly doubt this will help at all but oh well.
I want to sound like I know what im talking about :P

:Blob
18-09-2006, 04:44 PM
On the PHP script get the user name (like $user = GET CODE HERE) then you could have a scroll down thing with mute on, then if they select mute it gets the
username out of the field then you could have $update=mysql_query(UPDATE `$user` set `mute` '1')) like that, but they have to be fully registered.

YouFail
18-09-2006, 04:50 PM
Yep. Thats what it is. I was trying to think as I was sure I did something like that before but couldn't remember.

RyanS
18-09-2006, 05:15 PM
But i need it without the drop down menu.

I have seen it done before just don't know how, is there a way to like ignore ':mute' ?

YouFail
18-09-2006, 05:16 PM
You could most likely put in 1 form and make it edit the SQL details to mute the username i the box

RyanS
18-09-2006, 05:20 PM
Don't get it
:{

YouFail
18-09-2006, 05:34 PM
You have a form and you type in the username. That sends a request to the SQL to edit the mute level to 1 so he/she cannot be heard

RyanS
18-09-2006, 05:47 PM
Guess i will have to use a dropdown.

:Blob
18-09-2006, 06:01 PM
or, you have a button which they press with mute, and it shows a little popup box and they enter the name?

RyanS
18-09-2006, 06:04 PM
Dunno how :) Im a noob really lol.

:Blob
18-09-2006, 06:04 PM
I could probs firgue sometin out..

Want to hide these adverts? Register an account for free!