Repetare mesaj de intampinare in camera chat
Scris: Vin Mai 29, 2020
Am functia asta care iti adauga un mesaj in camera de chat bun venit
Acum treaba este ca daca intru cu 2 useri pe aceeasi camera se repeta mesajul fara ca sa mai pot scrie ceva,ce as putea face sa nu se mai repete mesajul ori de cate ori intra cineva nou in camera
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{
}
}