Cod: Selectaţi tot
function addtochat($uid, $rid)
{
global$xyz;
$timeto = 200;
$timenw = time();
$timeout = $timenw - $timeto;
$uid=getuid_sid($sid);
$exec =$xyz->query("DELETE FROM sh99x_chonline WHERE lton<'".$timeout."'");
$res =$xyz->query("INSERT INTO sh99x_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
$onlinecount=$xyz->query("SELECT COUNT(*) FROM sh99x_chonline WHERE rid='".$rid."' and uid='".$uid."'")->fetch_array();
if($onlinecount[0]=="0")
{
$camera=$xyz->query("SELECT name FROM sh99x_rooms WHERE id='".$rid."'")->fetch_array();
$chatok =$xyz->query("INSERT INTO sh99x_chat SET chatter='1', who='', timesent='".time()."', msgtext='/pp Salut @".getnick_uid($uid)." bine ai venit in camera ".$camera["name"]."', rid='".$rid."';");
}
if(!$res)
{
$xyz->query("UPDATE sh99x_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
}else{
}
}