To Modify Messages In Chatroom

Started on the old forum in January 2009 · view the original in the archive · old links redirect here

4 replies · 595 views · started 17 years ago · 1 min read

3 participants
Leviathan73 Senior · 260 posts #1

hi friends, in the chatroom after a few minutes the messages disappear, and then I would want to put to the left of the username and the text of the message that it goes under to the username hourly. how to be been able to modify this code? $chatok = mysql_query("INSERT INTO ibwf_chat SET chatter='".$uid."', who='".$who."', timesent='".time()."', msgtext='".$message."', rid='".$rid."';"); $lstmsg = mysql_query("UPDATE ibwf_rooms SET lastmsg='".time()."' WHERE id='".$rid."'");

        $hehe=mysql_fetch_array(mysql_query("SELECT chmsgs FROM ibwf_users WHERE id='".$uid."'"));
        $totl = $hehe[0]+1;
        $msgst= mysql_query("UPDATE ibwf_users SET chmsgs='".$totl."' WHERE id='".$uid."'");
        if($rinfo[1]==2)

thanks to whom resolves me this problem 😛

wapaawapaa Newbie · 2 posts #2

searche for theese lines 😉

        $timeto = 3600;
            $timenw = time();
            $timeout = $timenw-$timeto;
            $deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");

and change

        $timeto = 3600;

to whatever seconds you want (3600 ir 1hour)

Leviathan73 Senior · 260 posts #3

i have changed in 3600 but after a few minutes the message disappear to the room 😛 but i like the message never disappear to the room.. how i can do it?

something else Fellow · 2,296 posts #4

by doing this

//$deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");

or just deleting that line

Leviathan73 Senior · 260 posts #5

dosen t work 😀 message dissapear again after a few minutes. help please 👏

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close