How To Add This Function In Chat.php

Started on the old forum in February 2008 · view the original in the archive · old links redirect here

20 replies · 2,170 views · started 18 years ago · 1 min read

TL;DR · summary of 20 replies
  • - The solution to add the function who knows how to enter a room in chat.php was not fully resolved.
  • - mcKeny provided code for adding users to the chonline list, but it did not work as expected and needed further adjustments.
  • - Guest suggested checking if a user is already in the room using an SQL check before entering them into the chonline list.
  • - The thread concluded with multiple suggestions for additional features like kicking users or inviting others, but no specific code was provided.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

9 participants
metulj Super moderator Principal · 1,726 posts #21

where is the code?this? :

CODE $res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'"); if($res) { $msg = getnick_uid($uid)."enter the room"; mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', userid='0', text='".$msg."'"); } else { //just update the chonline list } dont remember if time sent is the correct field name anyways after doing that ....in the chat room when fetching the items from ibwf_chat eg $sql = mysql_query("SELECT userid,timesent,text FROM ibwf_chat"); while($item = mysql_fetch_array($sql)) { if($item[0]=='0') { $item[0]="chat_system"; echo $item[0].$item[1].$item[2]; } else { //print the items }

i have put in my addtochat function :

function addtochat($uid, $rid) { $timeto = 120; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'"); $res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'"); $res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");

if(!$res) { mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'"); } }

become this :

function addtochat($uid, $rid) { $timeto = 120; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'"); $res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'"); $res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");

if($res) { $msg = getnick_uid($uid)."enter the room"; mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', userid='0', text='".$msg."'"); } else { //just update the chonline list } dont remember if time sent is the correct field name anyways after doing that ....in the chat room when fetching the items from ibwf_chat eg $sql = mysql_query("SELECT userid,timesent,text FROM ibwf_chat"); while($item = mysql_fetch_array($sql)) { if($item[0]=='0') { $item[0]="chat_system"; echo $item[0].$item[1].$item[2]; } else { //print the items }

and i got this!!

Parse error: syntax error, unexpected T_STRING in /home/xxxxxx/public_html/web/core.php on line 713

you got 139 replies... AND ALL YOU DO IS COMPLAINING AND MOANING!!!!! even worse... you curse at users that helps here a lot! and you didnt even learn to use BB [ codebox ] PUT YOUR FKING CRAP IN BETWEEN HERE [ / codebox] go FK your self elsewhere and learn attitude External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

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