Show in room

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

66 replies · 2,763 views · started 17 years ago · 1 min read

TL;DR · summary of 66 replies
  • - The fix was to add session handling in chat.php using $_SESSION.
  • - The code approach involved adding session_name("PHPSESSID"); session_start(); $enter = isset($_SESSION['enter']) ? 1 : 0; at the top of chat.php, and checking $enter == 1 for entering the room.
  • - It was concluded that using sessions can prevent cheating by users who try to enter without being seen.

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
Ponick Developer · 216 posts #41

something else wrote: there is plenty of chat.php in on coding-talk just download another 1 🙂 .... when you editing scripts make a test folder so if u do make a mess up and dont know how to put it back then it wont matter 🙂

does it give you an error message why its not working? :)

if i give you my chat.php and index.php .... can you recod it ? 🙁

/* I don't know everything hehe */

Find me on facebook

ranzit2 Developer · 187 posts #46

Ponick wrote: im goin to say this bad news again...;(it didnot show any thing 🔫

its a function in core.php that had to b modified.

///////////////////////////////////////Add to chat

function addtochat($uid, $rid)
{
$bago = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."'"));
if($bago[0]==0){
$msg = "*mat Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', chatter='".$uid."', msgtext='".$msg."', rid='".$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)
{
mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
}

try this in core.php

and this in chat.php just after where if(!canenter($rid,$sid)) function end

addtochat($uid, $rid);
        $timeto = 300;
        $timenw = time();
        $timeout = $timenw-$timeto;
        $deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");
        $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
        $rname = $rooms[1];
        $nick = getnick_sid($sid);

she is beautifull than php.and i love her more than php.

kiLLeR-eyEd_14 Senior · 382 posts #47

ranzit2 wrote: its a function in core.php that had to b modified.

///////////////////////////////////////Add to chat


function addtochat($uid, $rid)
{
$bago = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."'"));
if($bago[0]==0){
$msg = "*mat Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', chatter='".$uid."', msgtext='".$msg."', rid='".$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)
{
mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
}

try this in core.php

and this in chat.php just after where if(!canenter($rid,$sid)) function end

addtochat($uid, $rid);
        $timeto = 300;
        $timenw = time();
        $timeout = $timenw-$timeto;
        $deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");
        $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
        $rname = $rooms[1];
        $nick = getnick_sid($sid);

it's very easy..just like my previous post..put this below if(isbanned){}

$bago = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."'"));
if($bago[0]==0)
{
$msg = "".getnick_uid($uid)." Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', chatter='".$uid."', msgtext='".$msg."', rid='".$rid."'");
}
something else Fellow · 2,296 posts #48

Ponick wrote: im goin to say this bad news again...;(it didnot show any thing 🔫

can u put this on top of the page after <?php

error_reporting (E_ALL); ini_set ('display_errors', true);

because its not showing any errors for me and that will tell you where the error is 🙂

Ponick Developer · 216 posts #49

kiLLeR-eyEd_14 wrote: it's very easy..just like my previous post..put this below if(isbanned){}

$bago = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."'"));
if($bago[0]==0)
{
$msg = "".getnick_uid($uid)." Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', chatter='".$uid."', msgtext='".$msg."', rid='".$rid."'");
}

it doesnt do anything 🙁 . Is there need any sql table specialy? Its be better if some one you guys kindly give me the tested those php file ....

/* I don't know everything hehe */

Find me on facebook

Ponick Developer · 216 posts #50

something else wrote: can u put this on top of the page after <?php error_reporting (E_ALL); ini_set ('display_errors', true); because its not showing any errors for me and that will tell you where the error is :)

i have used it but 😢 n0thing heppend

/* I don't know everything hehe */

Find me on facebook

Ponick Developer · 216 posts #52

Yes , i downloaded it from here . Named "lavalair plain script" can i see you site ?

/* I don't know everything hehe */

Find me on facebook

Ponick Developer · 216 posts #54

Yah nw nw it working . . But n0t like your site . . . 🙁 its working like= username time>>mat* entered !

Nw what i neet to do to make it like your site ??

/* I don't know everything hehe */

Find me on facebook

Ponick Developer · 216 posts #55

Every booody eid mubarak . .Happy eid day 🙂 🙂 . Ops am i flooding here ?

/* I don't know everything hehe */

Find me on facebook

ranzit2 Developer · 187 posts #56

Ponick wrote: Yah nw nw it working . . But n0t like your site . . . 🙁 its working like= username time>>mat* entered !

Nw what i neet to do to make it like your site ??

the function i posted take the core function and paste in core.php

she is beautifull than php.and i love her more than php.

Ponick Developer · 216 posts #57

ranzit2 wrote: the function i posted take the core function and paste in core.php

mmm thanx 🙂 . . . But when some one exit or loguot its not showing anything ! 😛

/* I don't know everything hehe */

Find me on facebook

Ponick Developer · 216 posts #58

Thanx every buddy 😀 now its working properly 🙂 🙂 🙂

you can see it now here

is there any system to show user leaving msg ? 🙂

/* I don't know everything hehe */

Find me on facebook

murshid7 Junior · 22 posts #60

its making me confused you said to add function in core.php already and i have done it and then it is showing as mate enter and then as ponick got the same problem and he also asked the a question about it and then you said him to paste the function to core.php what to do you mean? it is already done na? your saying a thing which as been done already i dont get it please tell me only that part.

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