Chat System

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

37 replies · 3,135 views · started 18 years ago · 1 min read

TL;DR · summary of 37 replies
  • -BoYzONe asked for help with a chat system that updates when users enter or leave the room, specifically needing assistance with the core.php file.
  • -The code was provided by Guest and modified slightly by rukiya. However, it still did not work as expected.
  • -Guest suggested replacing the addtochat function to include details about who entered the room using a /me tool, but this change also didn't resolve the issue.
  • -Acrylicimo shared another piece of code that was meant to reveal who entered the chat room, which could be used in conjunction with the existing code.

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

11 participants
BoYzONe Developer · 88 posts #1

Anybody can help me to solve this??I want this appear everytime user enter the rum.

Chat System : John enter the room browser mozilla 4.0

i have seach about this topic but not found..Give me the link if this topic already exist..And help me to solve this if this is the first topic that discuss about this.thanks friend.

metulj Super moderator Principal · 1,726 posts #2

theres no need to create 4 exact same topics you know?!

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ノ刀ノイリ!

BoYzONe Developer · 88 posts #3

As i said.Plz give me the link if the topic already exist.Thanks.

Guest #5

i hve dat code 😀

ritu Newbie · 8 posts #6

shakir if you have the code then why don't you share that with us if you dont mind !! 😛

hello to PHP

my chat site

!! Glad To Be HeRe !!

Guest #7
$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
}

this code already posted by mckeny juz use search button

Guest #8

check it ritu 😛

BoYzONe Developer · 88 posts #9

this code already posted by mckeny juz use search button

update chat online list?But mckeny said to update at add to chat in core.php?

Guest #11

try to update

BoYzONe Developer · 88 posts #13

my chat script's alpha version demo

http://bdfun.co.cc/romi

beta version's screenshot

nice chat place rukiya..But i want that code for lavair.

BoYzONe Developer · 88 posts #15

There is an error on core.php at line 1181 when i enter the room.

BoYzONe Developer · 88 posts #16

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 got some question here..

  1. what u mean with //just update the chonline list

  2. this is my add to chat..how to edit it?

CODEfunction 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."'"); } }

  1. where must i put

CODEdont 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 }

hope somebody will answer me..

BoYzONe Developer · 88 posts #17

Just need help for a last step.Hope someone willing to help me.

BoYzONe Developer · 88 posts #18

Anybody?Its that everybody here are selfish?

Guest #19

Anybody?Its that everybody here are selfish?

Replace your addtochat function with

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."'");
if($res)
{
$msg = "/me Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', userid='".$uid."', text='".$msg."'");
}else{
mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
}
}

Make Sure that the users are allowed to use /me tool... If not you can remove the /me in $msg variable...

Guest #20

Replace your addtochat function with

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."'");
if($res)
{
$msg = "/me Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', userid='".$uid."', text='".$msg."'");
}else{
mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
}
}

Make Sure that the users are allowed to use /me tool... If not you can remove the /me in $msg variable...

Not working

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