1){ return $plu; }} function este_topic($topic){ $catet = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_topics WHERE id=$topic")); if($catet[0]>0) return $catet[0]; } function este_postare($postare,$topic){ $catet = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts WHERE id=$postare AND tid=$topic")); if($catet[0]>0) return true; else return false; } function este_postare_x($postare){ $catet = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts WHERE id=$postare")); if($catet[0]>0) return true; else return false; } function _xerori($text){ $corect = htmlspecialchars(stripslashes(trim(str_replace('$','$$',$text)))); return nl2br($corect); } function puncte_forum($uid) { $nrpct = mysql_fetch_array(mysql_query("SELECT forump FROM lib3rtymrc_users WHERE id='".$uid."'")); return $nrpct[0]; } ///////// function gm($gm) { if($gm=='3873') { return "\"$nume\"/
"; }else{ return "\"$nume\"/
"; } } function este_gm($gm) { if($gm=='3873') { return true; }else{ return false; } } function connectdb() { global $dbname, $dbuser, $dbhost, $dbpass; $conms = @mysql_connect($dbhost,$dbuser,$dbpass); //connect mysql if(!$conms) return false; $condb = @mysql_select_db($dbname); if(!$condb) return false; return true; } function scoatebrowser($uid) { $getonm = mysql_fetch_array(mysql_query("SELECT browserm FROM lib3rtymrc_users WHERE id='".$uid."'")); return $getonm[0]; } function scoateip($uid) { $getonm = mysql_fetch_array(mysql_query("SELECT ipadd FROM lib3rtymrc_users WHERE id='".$uid."'")); return $getonm[0]; } function obtinedatanasterii($date,$sid){ list($anul,$luna,$ziua)=explode("-",$date); if(($luna=="01" && $ziua>20)||($luna=="02" && $ziua<19)){ return "Varsator"; }else if(($luna=="02" && $ziua>18)||($luna=="03" && $ziua<21)){ return "Pesti"; }else if(($luna=="03" && $ziua>20)||($luna=="04" && $ziua<20)){ return "Berbec"; }else if(($luna=="04" && $ziua>19)||($luna=="05" && $ziua<21)){ return "Taur"; }else if(($luna=="05" && $ziua>20)||($luna=="06" && $ziua<22)){ return "Gemeni"; }else if(($luna=="06" && $ziua>21)||($luna=="07" && $ziua<23)){ return "Rac"; }else if(($luna=="07" && $ziua>22)||($luna=="08" && $ziua<23)){ return "Leu"; }else if(($luna=="08" && $ziua>22)||($luna=="09" && $ziua<23)){ return "Fecioara"; }else if(($luna=="09" && $ziua>22)||($luna=="10" && $ziua<24)){ return "Balanta"; }else if(($luna=="10" && $ziua>23)||($luna=="11" && $ziua<23)){ return "Scorpion"; }else if(($luna=="11" && $ziua>22)||($luna=="12" && $ziua<22)){ return "Sagetator"; }else if(($luna=="12" && $ziua>21)||($luna=="01" && $ziua<21)){ return "Capricorn"; }else { return "nesetata"; } } function NR($numar){ $numarx = "$numar"; if($numar < 1000){ $nom = $numar; }else if ($numar > 999 && $numar < 10000){ $nom = $numarx[0].'.'.$numarx[1].$numarx[2].$numarx[3]; }else if ($numar > 9999 && $numar < 100000){ $nom = $numarx[0].$numarx[1].'.'.$numarx[2].$numarx[3].$numarx[4]; }else if ($numar > 99999 && $numar < 1000000){ $nom = $numarx[0].$numarx[1].$numarx[2].'.'.$numarx[3].$numarx[4].$numarx[5]; }else if ($numar > 999999 && $numar < 10000000){ $nom = $numarx[0].'.'.$numarx[1].$numarx[2].$numarx[3].'.'.$numarx[4].$numarx[5].$numarx[6]; }else if ($numar > 9999999 && $numar < 100000000){ $nom = $numarx[0].$numarx[1].'.'.$numarx[2].$numarx[3].$numarx[4].'.'.$numarx[5].$numarx[6].$numarx[7]; return $nom; }else if ($numar > 99999999 && $numar < 1000000000){ $nom = $numarx[0].$numarx[1].'.'.$numarx[2].'.'.$numarx[3].$numarx[4].$numarx[5].'.'.$numarx[6].$numarx[7].$numarx[8]; }else if ($numar > 999999999 && $numar < 10000000000){ $nom = $numarx[0].'.'.$numarx[1].$numarx[2].'.'.$numarx[3].'.'.$numarx[4].$numarx[5].$numarx[6].'.'.$numarx[7].$numarx[8].$numarx[9]; }else{ $nom = $numar; } return $nom; } function functie($uid) { $functie = mysql_fetch_array(mysql_query("SELECT functie FROM lib3rtymrc_users WHERE id='".$uid."'")); return $functie[0]; } function saveuinfo($sid) { $headers = apache_request_headers(); $alli = ""; foreach ($headers as $header => $value) { $alli .= "$header: $value
"; } $alli .= "IP: ".$_SERVER['REMOTE_ADDR']."
"; $alli .= "REFERRER: ".$_SERVER['HTTP_REFERER']."
"; $alli .= "REMOTE HOST: ".getenv('REMOTE_HOST')."
"; $alli .= "PROX: ".$_SERVER['HTTP_X_FORWARDED_FOR']."
"; $alli .= "HOST: ".getenv('HTTP_X_FORWARDED_HOST')."
"; $alli .= "SERV: ".getenv('HTTP_X_FORWARDED_SERVER')."
"; if(trim($sid)!="") { $uid = getuid_sid($sid); $fname = "tmp/".getnick_uid($uid).".rwi"; $out = fopen($fname,"w"); fwrite($out,$alli); fclose($out); } //return 0; } /// inregistrare! function registerform($ef) { echo ' Completati corect profilul pentru a putea fi validat(a)!
Asta consta in realitate, un motto cumsecade, un nick adecvat!
Daca aveti eventuale probleme da-ti add id-ului de messenger magicworld_chat@yahoo.com!
Daca nu va completati CORECT profilul puteti ajunge sa nu fiti VALIDATI si chiar BANATI!

'; $ue = $errl = $pe = $ce = ""; switch($ef) { case 1: $errl = "\"!\"/ Scrie numele"; $ue = "\"!\"/"; break; case 2: $errl = "\"!\"/ Scrie parola"; $pe = "\"!\"/"; break; case 3: $errl = "\"!\"/ Repeta parola"; $ce = "\"!\"/"; break; case 4: $errl = "\"!\"/Numele introdus este invalid"; $ue = "\"!\"/"; break; case 5: $errl = "\"!\"/ Parola este invalida"; $pe = "\"!\"/"; break; case 6: $errl = "\"!\"/ Parolele nu se potrivesc"; $ce = "\"!\"/"; break; case 7: $errl = "\"!\"/ Numele trebuie sa contina macar 4 caractere"; $ue = "\"!\"/"; break; case 8: $errl = "\"!\"/ Parola trebuie sa contina macar 4 caractere"; $pe = "\"!\"/"; break; case 9: $errl = "\"!\"/ Acest nume exista, alege altul"; $ue = "\"!\"/"; break; case 10: $errl = "\"!\"/ Eroare in baza de date, incearca mai tarziu"; break; case 11: $errl = "\"!\"/ Numele trebuie sa inceapa cu o litera"; $ue = "\"!\"/"; break; case 12: $errl = "\"!\"/ Acest nume este rezervat de catre proprietarul siteului,va rugam sa va alegeti alt nume"; $ue = "\"!\"/"; break; case 13: $errl = "\"!\"/ Alcest nume este blocat,va rugam sa alegeti alt nume"; $ue = "\"!\"/"; break; case 14: $errl = "\"!\"/ Scrie adresa de e-mail"; $me = "\"!\"/"; break; case 15: $errl = "\"!\"/ Scrie adresa"; $ad = "\"!\"/"; break; case 16: $errl = "\"!\"/ Scrie cod recuperare parola"; $codr = "\"!\"/"; break; } $rform = "$ue (*)Numele:
"; $rform .= "$pe (*)Parola:
"; $rform .= "$ce (*)Repeta parola:
"; $rform .= "$ad (*)Locatia:
"; //$rform .= "$me (*)E-mail:
"; $rform .= "MoTTo:
"; $rform .= "(*)Data nasterii
"; $rform .= ""; $rform .= ""; $rform .= "
"; $rform .= "Sex:"; $rform .= "
"; $rform .= "$codr Cod Recuperare:
"; $rform .= "»Inregistrare"; if (isset($_GET['pr'])&&is_numeric($_GET['pr'])){ $rform .= ""; }else{ $rform .= ""; } $rform .= ""; $rform .= ""; $rform .= ""; $rform .= ""; $rform .= ""; $rform .= ""; $rform .= ""; $rform .= ""; $rform .= ""; $rform .= ""; $rform .= ""; $rform .= "«
"; $rform .= "
$errl"; return $rform; } function sex($id){ $gen = mysql_fetch_array(mysql_query("SELECT sex FROM lib3rtymrc_users WHERE id='".$id."'")); if($gen[0]=='M'){ return true; }else if($gen[0]=='F'){ return false; }else{ return true; } } ///////////////////////////////////////////// Prim function chefpm($uid) { $getdata = mysql_fetch_array(mysql_query("SELECT chefpm FROM lib3rtymrc_users WHERE id='".$uid."'")); if($getdata[0]==""){ $nu = "nesetat"; return $nu; }else if($getdata[0]!==""){ return $getdata[0]; } } function Prim($sid) { $link = ""; $link .= ""; $link .= "Acasa"; return $link; } function nume_id($uid,$sid) { $nume = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_users WHERE id='".$uid."'")); return "".getsimbol($uid)."$nume[0]"; } ///// function PmNou($sid) { $pmnou = getunreadpm(getuid_sid($sid)); if ($pmnou>0) { if($pmnou==1) { $mesaj = "un mesaj nou"; }else{ $mesaj = "mesaje noi"; } $lore = "\".\"/Aveti $pmnou $mesaj
"; } return $lore; } function addtoforum($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_onlineforum WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO lib3rtymrc_onlineforum SET lton='".time()."', uid='".$uid."'"); if(!$res) { mysql_query("UPDATE lib3rtymrc_onlineforum SET lton='".time()."' WHERE uid='".$uid."'"); } } //////////////////////////////////////////// Search Id function generate_srid($svar1,$svar2="", $svar3="", $svar4="", $svar5="") { $res = mysql_fetch_array(mysql_query("SELECT id FROM lib3rtymrc_search WHERE svar1 like '".$svar1."' AND svar2 like '".$svar2."' AND svar3 like '".$svar3."' AND svar4 like '".$svar4."' AND svar5 like '".$svar5."'")); if($res[0]>0) { return $res[0]; } mysql_query("INSERT INTO lib3rtymrc_search SET svar1='".$svar1."', svar2='".$svar2."', svar3='".$svar3."', svar4='".$svar4."', svar5='".$svar5."', stime='".time()."'"); $res = mysql_fetch_array(mysql_query("SELECT id FROM lib3rtymrc_search WHERE svar1 like '".$svar1."' AND svar2 like '".$svar2."' AND svar3 like '".$svar3."' AND svar4 like '".$svar4."' AND svar5 like '".$svar5."'")); return $res[0]; } ///////////////////////////poate pune poze la album function pozealbum($uid) { $valida8 = @mysql_fetch_array(mysql_query("SELECT permxmagic, album FROM lib3rtymrc_users WHERE id='".$uid."' AND album='1'")); if(($valida8[1]=='1')&&($valida8[0]>'0')) { return true; }else{ return false; } } /////////////////////////////////////////////Forum Link function forumlink($sid) { $categories = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_fcats")); if($categories[0]==1) { $fcats = mysql_query("SELECT id, name FROM lib3rtymrc_fcats ORDER BY position, id"); while($fcat=mysql_fetch_array($fcats)) { $link = "$fcat[1]
"; } }else{ $link = "Forum
"; } return $link; } ///////////////////////////////////////////////pt download function candelvl($uid, $item) { $candoit = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_vault WHERE id='".$item."'")); if($uid==$candoit[0]||ismod($uid)) { return true; } return false; } ///////////////////////////////////////////////sterge poza album function candelgal($uid, $item) { $candoit = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_gallery WHERE id='".$item."'")); if($uid==$candoit[0]||ismod($uid)) { return true; } return false; } //////// candidati function candelcand($uid, $item) { $candoit = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rty_justme WHERE id='".$item."'")); if($uid==$candoit[0]||ismod($uid)) { return true; } return false; } ////////////////////////////sterge manele mp3 function candelmanele($uid, $item) { $candoit = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_manele WHERE id='".$item."'")); if($uid==$candoit[0]||ismod($uid)) { return true; } return false; } /////////////////////////////////// GET RATE function geturate($uid) { $pnts = 0; //by blogs, posts per day, chats per day, gb signatures if(ismod($uid)) { return 5; } $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_blogs WHERE bowner='".$uid."'")); if($noi[0]>=5) { $pnts = 5; }else{ $pnts = $noi[0]; } $noi = mysql_fetch_array(mysql_query("SELECT regdate, plusses, chmsgs FROM lib3rtymrc_users WHERE id='".$uid."'")); $rwage = ceil((time()- $noi[0])/(24*60*60)); $ppd = ceil($noi[1]/$rwage); if($ppd>=20) { $pnts+=5; }else{ $pnts += floor($ppd/4); } $cpd = ceil($noi[2]/$rwage); if($cpd>=100) { $pnts+=5; }else{ $pnts += floor($cpd/20); } return floor($pnts/3); } ///////////////////////////////////function isuser function isuser($uid) { $cus = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_users WHERE id='".$uid."'")); if($cus[0]>0) { return true; } return false; } ////////////////////////////////////////////Can access forum function canaccess($uid, $fid) { $fex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_forums WHERE id='".$fid."'")); if($fex[0]==0) { return false; } $persc = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_acc WHERE fid='".$fid."'")); if($persc[0]==0) { $clid = mysql_fetch_array(mysql_query("SELECT clubid FROM lib3rtymrc_forums WHERE id='".$fid."'")); if($clid[0]==0) { return true; }else{ if(ismod($uid)) { return true; }else{ $ismm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_clubmembers WHERE uid='".$uid."' AND clid='".$clid[0]."'")); if($ismm[0]>0) { return true; }else{ return false; } } } }else{ $gid = mysql_fetch_array(mysql_query("SELECT gid FROM lib3rtymrc_acc WHERE fid='".$fid."'")); $gid = $gid[0]; $ginfo = mysql_fetch_array(mysql_query("SELECT autoass, mage, userst, posts, plusses FROM lib3rtymrc_groups WHERE id='".$gid."'")); if($ginfo[0]=="1") { $uperms = mysql_fetch_array(mysql_query("SELECT birthday, permxmagic, posts, plusses FROM lib3rtymrc_users WHERE id='".$uid."'")); if($ginfo[2]==4) { if(isowner1($uid)) { return TRUE; }else{ return FALSE; } } if($ginfo[2]==3) { if(isowner($uid)) { return TRUE; }else{ return FALSE; } } if($ginfo[2]==2) { if(isadmin($uid)) { return true; }else{ return false; } } if($ginfo[2]==1) { if(ismod($uid)) { return true; }else{ return false; } } if($uperms[1]>$ginfo[2]) { return true; } $acc = true; if(getage($uperms[0])< $ginfo[1]) { $acc = false; } if($uperms[2]<$ginfo[3]) { $acc = false; } if($uperms[3]<$ginfo[4]) { $acc = false; } if($uperms[4]<$ginfo[5]) { $acc = false; } } } return $acc; } function canaccess1($uid, $fid) { $fex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_forums2 WHERE id='".$fid."'")); if($fex[0]==0) { return false; } $persc = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_acc WHERE fid='".$fid."'")); if($persc[0]==0) { $clid = mysql_fetch_array(mysql_query("SELECT clubid FROM lib3rtymrc_forums2 WHERE id='".$fid."'")); if($clid[0]==0) { return true; }else{ if(ismod($uid)) { return true; }else{ $ismm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_clubmembers WHERE uid='".$uid."' AND clid='".$clid[0]."'")); if($ismm[0]>0) { return true; }else{ return false; } } } }else{ $gid = mysql_fetch_array(mysql_query("SELECT gid FROM lib3rtymrc_acc WHERE fid='".$fid."'")); $gid = $gid[0]; $ginfo = mysql_fetch_array(mysql_query("SELECT autoass, mage, userst, posts, plusses FROM lib3rtymrc_groups WHERE id='".$gid."'")); if($ginfo[0]=="1") { $uperms = mysql_fetch_array(mysql_query("SELECT birthday, permxmagic, posts, plusses FROM lib3rtymrc_users WHERE id='".$uid."'")); if($ginfo[2]==4) { if(isowner1($uid)) { return TRUE; }else{ return FALSE; } } if($ginfo[2]==3) { if(isowner($uid)) { return TRUE; }else{ return FALSE; } } if($ginfo[2]==2) { if(isadmin($uid)) { return true; }else{ return false; } } if($ginfo[2]==1) { if(ismod($uid)) { return true; }else{ return false; } } if($uperms[1]>$ginfo[2]) { return true; } $acc = true; if(getage($uperms[0])< $ginfo[1]) { $acc = false; } if($uperms[2]<$ginfo[3]) { $acc = false; } if($uperms[3]<$ginfo[4]) { $acc = false; } if($uperms[4]<$ginfo[5]) { $acc = false; } } } return $acc; } function unhtmlspecialchars2( $string ) { $string = str_replace ( '&', '&', $string ); $string = str_replace ( ''', '\'', $string ); $string = str_replace ( '"', '"', $string ); $string = str_replace ( '<', '<', $string ); $string = str_replace ( '>', '>', $string ); $string = str_replace ( 'ü', '?', $string ); $string = str_replace ( 'Ü', '?', $string ); $string = str_replace ( 'ä', '?', $string ); $string = str_replace ( 'Ä', '?', $string ); $string = str_replace ( 'ö', '?', $string ); $string = str_replace ( 'Ö', '?', $string ); return $string; } function getuage_sid($sid) { $uid = getuid_sid($sid); $uage = mysql_fetch_array(mysql_query("SELECT birthday FROM lib3rtymrc_users WHERE id='".$uid."'")); return getage($uage[0]); } function canenter($rid, $sid) { $rperm = mysql_fetch_array(mysql_query("SELECT mage, perms, chposts, clubid FROM lib3rtymrc_rooms WHERE id='".$rid."'")); $uperm = mysql_fetch_array(mysql_query("SELECT birthday, chmsgs FROM lib3rtymrc_users WHERE id='".getuid_sid($sid)."'")); if($rperm[3]!=0) { if(ismod(getuid_sid($sid))) { return true; }else{ $ismm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_clubmembers WHERE uid='".getuid_sid($sid)."' AND clid='".$rperm[3]."'")); if($ismm[0]>0) { return true; }else{ return false; } } } if($rperm[1]==1) { return ismod(getuid_sid($sid)); } if($rperm[1]==2) { return isadmin(getuid_sid($sid)); } if($rperm[1]==3) { return isowner(getuid_sid($sid)); } if($rperm[1]==4) { return isowner1(getuid_sid($sid)); } if(getuage_sid($sid)<$rperm[0]) { return false; } if($uperm[1]<$rperm[2]) { return false; } return true; } ///////////////////clear data function cleardata() { $timeto = 2400000; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_notificare WHERE timesent<'".$timeout."' AND unread='0'"); $timeto = 2400000; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_chonline WHERE lton<'".$timeout."'"); $timeto = 5*24*60*60; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_chat WHERE timesent<'".$timeout."'"); $timeto = 60*60; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_search WHERE stime<'".$timeout."'"); ///delete expired rooms $timeto = 5*60; $timenw = time(); $timeout = $timenw - $timeto; $rooms = mysql_query("SELECT id FROM lib3rtymrc_rooms WHERE static='0' AND lastmsg<'".$timeout."'"); while ($room=mysql_fetch_array($rooms)) { $ppl = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_chonline WHERE rid='".$room[0]."'")); if($ppl[0]==0) { $exec = mysql_query("DELETE FROM lib3rtymrc_rooms WHERE id='".$room[0]."'"); } } $lbpm = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='lastbpm'")); $td = date("Y-m-d"); //echo $lbpm[0]; if ($td!=$lbpm[0]) { //echo "boo"; $sql = "SELECT id, name, birthday FROM lib3rtymrc_users where month(`birthday`) = month(curdate()) and dayofmonth(`birthday`) = dayofmonth(curdate())"; $ppl = mysql_query($sql); while($mem = mysql_fetch_array($ppl)) { $msg = "La multi ani!!!-party-Echipa $sitte iti doreste tot binele din lume si nu uita aici e a doua ta familie! Ceva optional pe maine o lamaie:D[br/]*fireworks*[br/][small][i]P.S.:acesta este un PM automat![/i][/small]"; autopm($msg, $mem[0]); } mysql_query("UPDATE lib3rtymrc_settings SET value='".$td."' WHERE name='lastbpm'"); } } ////////////////////////////pm la toti userii function mass($text,$uid,$mod){ if($mod==1){ $sql = @mysql_query("SELECT id FROM lib3rtymrc_users"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO lib3rtymrc_private SET byuid = '$uid', touid = '".$id[0]."', text = '[b]PM catre toti userii:[/b][br/]".$text."', timesent = '".time()."'"); } }else if($mod==2){ $offline = 24 * 60 * 60; $sql = @mysql_query("SELECT * from `lib3rtymrc_users` WHERE lastact>'".intval(time()-$offline)."'"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO lib3rtymrc_private SET byuid = '$uid', touid = '".$id[0]."', text = '[b]PM catre userii activi in ultimele 24 h:[/b][br/]".$text."', timesent = '".time()."'"); } }else if($mod==3){ $sql = @mysql_query("SELECT id FROM lib3rtymrc_users WHERE permxmagic > 0"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO lib3rtymrc_private SET byuid = '".$uid."', touid = '".$id[0]."', text = '[b]PM catre echipa:[/b][br/]".$text."', timesent = '".time()."'"); } } } ///////////////////////////////////////get file ext. function getext($strfnm) { $str = trim($strfnm); if (strlen($str)<4){ return $str; } for($i=strlen($str);$i>0;$i--) { $ext .= substr($str,$i,1); if(strlen($ext)==3) { $ext = strrev($ext); return $ext; } } } ///////////////////////////////////////get extension icon function getextimg($ext) { $ext = strtolower($ext); switch ($ext) { case "bmp": return "\"image\"/"; break; case "png": return "\"image\"/"; break; case "gif": return "\"image\"/"; break; case "jpg": return "\"image\"/"; break; case "jpeg": return "\"image\"/"; break; case "rar": return "\"package\"/"; break; case "zip": case "rar": return "\"package\"/"; break; case "wav": return "\"music\"/"; break; case "amr": return "\"music\"/"; break; case "mp3": return "\"music\"/"; break; case "mp4": return "\"music\"/"; break; case "mpg": case "3gp": return "\"video\"/"; break; case "sis": return "\"video\"/"; break; case "jar": return "\"video\"/"; break; case "jad": return "\"video\"/"; break; default: return "\"!\"/"; break; } } ///////////////////////////////////////Add to chat function addtochat($uid, $rid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_chonline WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO lib3rtymrc_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'"); if(!$res) { mysql_query("UPDATE lib3rtymrc_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'"); } } ////////////////////////////////////////////is mod function ismod($uid) { $perm = mysql_fetch_array(mysql_query("SELECT permxmagic, OK_TEAM FROM lib3rtymrc_users WHERE id='".$uid."'")); if($perm[0]>0 && $perm[1]==1) { return true; } } ////////////////////////////////////////////is mod function candelgb($uid,$mid) { $minfo = mysql_fetch_array(mysql_query("SELECT gbowner, gbsigner FROM lib3rtymrc_gbook WHERE id='".$mid."'")); if($minfo[0]==$uid || ismod($uid)) { return true; } if($minfo[1]==$uid) { return true; } return false; } ////////////////////////////////////////////Spam filter function isspam($text) { $res = mysql_query("SELECT spam FROM lib3rtymrc_blockedspam"); while ($row = mysql_fetch_array($res)) { $sfil[] = $row[0]; } $text = str_replace(" ", "", $text); $text = strtolower($text); for($i=0;$i0) { return true; } } return false; } /////////////////////// * spam chat * ////////////////////////////////////////////Spam filter function ischspam($text) { $sfil[0] = "www."; $sfil[1] = "muist"; $sfil[2] = "idiot"; $sfil[3] = "futangiu"; $sfil[4] = ".hu"; $sfil[5] = "tushady"; $sfil[6] = ".biz"; $sfil[7] = "frec"; $sfil[8] = "pizda"; $sfil[9] = "cacat"; $sfil[10] = "peperonity"; $sfil[11] = "pula"; $sfil[12] = "muie"; $sfil[13] = "fut"; $sfil[14] = "sugi"; $sfil[15] = "coaie"; $sfil[16] = "friends"; $text = str_replace(" ", "", $text); $text = strtolower($text); for($i=0;$i0) { return true; } } return false; } ///////////////////////////////////get page from go function getpage_go1($go,$tid) { if(trim($go)=="")return 1; if($go=="last")return getnumpages($tid); $counter=1; $posts = mysql_query("SELECT id FROM lib3rtymrc_posts2 WHERE tid='".$tid."'"); while($post=mysql_fetch_array($posts)) { $counter++; $postid = $post[0]; if($postid==$go) { $tore = ceil($counter/1); return $tore; } } return 1; } ///////////////////////////////////get page from go function getpage_go($go,$tid) { if(trim($go)=="")return 1; if($go=="last")return getnumpages($tid); $counter=1; $posts = mysql_query("SELECT id FROM lib3rtymrc_posts WHERE tid='".$tid."'"); while($post=mysql_fetch_array($posts)) { $counter++; $postid = $post[0]; if($postid==$go) { $tore = ceil($counter/5); return $tore; } } return 1; } ////////////////////////////get number of topic pages function getnumpages1($tid) { $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts2 WHERE tid='".$tid."'")); $nops = $nops[0]+1; //where did the 1 come from? the topic text, duh! $nopg = ceil($nops/1); //5 is the posts to show in each page return $nopg; } ////////////////////////////get number of topic pages function getnumpages($tid) { $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts WHERE tid='".$tid."'")); $nops = $nops[0]+1; //where did the 1 come from? the topic text, duh! $nopg = ceil($nops/5); //5 is the posts to show in each page return $nopg; } ////////////////////////////////////////////can delete a blog? function candelbl($uid,$bid) { $minfo = mysql_fetch_array(mysql_query("SELECT bowner FROM lib3rtymrc_blogs WHERE id='".$bid."'")); if(ismod($uid)) { return true; } if($minfo[0]==$uid) { return true; } return false; } //////////////////////////////////////////////////RAVEBABE function PostToHost($host, $path, $data_to_send) { $result = ""; $fp = fsockopen($host,80,$errno, $errstr, 30); if( $fp) { fputs($fp, "POST $path HTTP/1.0 "); fputs($fp, "Host: $host "); fputs($fp, "Content-type: application/x-www-form-urlencoded "); fputs($fp, "Content-length: " . strlen($data_to_send) . " "); fputs($fp, "Connection: close "); fputs($fp, $data_to_send); while(!feof($fp)) { $result .= fgets($fp, 128); } fclose($fp); return $result; } } /////////////////////////Get user plusses function getchmsgs($uid) { $plus = mysql_fetch_array(mysql_query("SELECT chmsgs FROM lib3rtymrc_users WHERE id='".$uid."'")); return $plus[0]; } /////////////////////////Get user plusses function getplusses($uid) { $plus = mysql_fetch_array(mysql_query("SELECT plusses FROM lib3rtymrc_users WHERE id='".$uid."'")); return $plus[0]; } function monezi($mid) { $monezi = mysql_fetch_array(mysql_query("SELECT monezi FROM lib3rtymrc_users WHERE id='".$mid."'")); return $monezi[0]; } /////////////////////////Can uid sign who's guestbook? function cansigngb($uid, $who) { if(arebuds($uid, $who)) { return true; } if($uid==$who) { return false; //imagine if someone signed his own gbook o.O } if(getplusses($uid)>=25) { return true; } return false; } /////////////////////////////////////////////Are buds? function arebuds($uid, $tid) { $res = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_buddies WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='1'")); if($res[0]>0) { return true; } return false; } /////////////////////////////////////////////popups on function popupson($who) { $res = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_users WHERE id='".$who."' AND popmsg='1'")); if($res[0]>0) { return true; } return false; } //////////////////////////////////function get n. of buds function getnbuds($uid) { $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_buddies WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'")); return $notb[0]; } /////////////////////////////get no. of requists function getnreqs($uid) { $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_buddies WHERE tid='".$uid."' AND agreed='0'")); return $notb[0]; } /////////////////////////////get no. of online buds function getonbuds($uid) { $counter =0; $buds = mysql_query("SELECT uid, tid FROM lib3rtymrc_buddies WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'"); while($bud=mysql_fetch_array($buds)) { if($bud[0]==$uid) { $tid = $bud[1]; }else{ $tid = $bud[0]; } if(isonline($tid)) { $counter++; } } return $counter; } /////////////////////////////////////////////Mesaj Live function getshoutbox1($sid){ $shbox = ""; $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM lib3rtymrc_shouts1 ORDER BY shtime DESC LIMIT 1")); $shnick = getnick_uid($lshout[1]); $shbox .= "".getsimbol($lshout[1])."".$shnick.": "; $shbox .= parsepm($lshout[0],$sid); $shbox .= "
"; if(mliveon()) { if(ismod(getuid_sid($sid))) { $shbox .= "[+] "; $shbox .= "[#]"; } }else{ } //if (isowner1(getuid_sid($sid))){ if(ismod(getuid_sid($sid))) { $shbox .= "[+]"; $shbox .= " [scrie]"; $shbox .= " [x]"; } $shbox .= "
"; return $shbox; } /////////////////////////////////////////////Mesaj Live function getshoutbox($sid){ $shbox = ""; $shbox .= "Mesaje Live
"; $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM lib3rtymrc_shouts ORDER BY shtime DESC LIMIT 1")); $shnick = getnick_uid($lshout[1]); $shbox .= "".$shnick.": "; $shbox .= parsepm($lshout[0],$sid); $shbox .= "
"; $shbox .= "toate"; $eu = getuid_sid($sid); if($lshout[1]!==$eu){ $shbox .= " | scrie"; }else{ $shbox .= " | editeaza"; } //if (isowner1(getuid_sid($sid))){ if(ismod(getuid_sid($sid))) { $shbox .= " | sterge"; } $shbox .= "
"; return $shbox; } function echipax($sid){ $shbox = ""; //$shbox .= "Mesaje Live
"; $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM ice_echipa ORDER BY shtime DESC LIMIT 1")); $shnick = getnick_uid($lshout[1]); $shbox .= "".getsimbol($lshout[1])."".$shnick.": "; $shbox .= parsepm($lshout[0],$sid); $shbox .= "
"; if(ismod(getuid_sid($sid))) { $shbox .= "toate"; $eu = getuid_sid($sid); if($lshout[1]!==$eu){ $shbox .= " | scrie"; }else{ $shbox .= " | editeaza"; } $shbox .= " | sterge
"; } $shbox .= "
"; return $shbox; } ///////////////////////////////////////////// Alertele function popup($sid) { $uid = getuid_sid($sid); $unreadpopup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_popups WHERE unread='1' AND touid='".$uid."'")); if ($unreadpopup[0]>0) { $popmsgbox .= "

"; $popsenabled=mysql_fetch_array(mysql_query("SELECT popmsg FROM lib3rtymrc_users WHERE id='".$uid."'")); if($popsenabled[0]==1) { $pminfo = mysql_fetch_array(mysql_query("SELECT id, text, byuid, timesent, touid, reported FROM lib3rtymrc_popups WHERE unread='1' AND touid='".$uid."'")); $pmfrm = getnick_uid($pminfo[2]); if(isonline($pminfo[2])) { $iml = "\"+\"/"; }else{ $iml = "\"-\"/"; } $ncl = mysql_query("UPDATE lib3rtymrc_popups SET unread='0' WHERE id='".$pminfo[0]."'"); $popmsgbox .= "(!)Alerta "; $popmsgbox .= "
"; $popmsgbox .= " $iml".getsimbol($pminfo[2])."$pmfrm"; $popmsgbox .= "
"; $tmstamp = $pminfo[3]; $tmdt = date("d m Y - H:i:s", $tmstamp); $popmsgbox .= "$tmdt
"; $pmtext = parsepm($pminfo[1], $sid); $pmtext = str_replace("/llfaqs","$sitename F.A.Qs", $pmtext); $pmtext = str_replace("/reader",getnick_uid($pminfo[4]), $pmtext); $pmid=$pminfo[0]; //spam if(isspam($pmtext, getuid_sid($sid))) { if(($pminfo[5]=="0") && ($pminfo[2]!=1)) { mysql_query("UPDATE lib3rtymrc_popups SET reported='1' WHERE id='".$pmid."'"); } } // $popmsgbox .= "$pmtext"; $popmsgbox .= "
"; //$popmsgbox .= "
Send Reply to $pmfrm
"; $popmsgbox .= "
"; $popmsgbox .= "»Raspunde"; $popmsgbox .= ""; $popmsgbox .= "«"; $popmsgbox .= "
"; // $res = mysql_query("INSERT INTO lib3rtymrc_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'"); $location = mysql_fetch_array(mysql_query("SELECT placedet FROM lib3rtymrc_online WHERE userid='".$uid."'")); $popmsgbox .= "»Ignora Alerta«
"; $popmsgbox .= "»Raporteaza«
"; $popmsgbox .= "»Dialog«
"; $popmsgbox .= "Mod primire Alerte
"; $popmsgbox .= "
"; $popmsgbox .= "Confirma"; $popmsgbox .= "
"; $alerte = mysql_fetch_array(mysql_query("SELECT alerte FROM lib3rtymrc_users WHERE id='".$uid."'")); if($alerte[0]==1) { $popmsgbox .= "»Activeaza alertele numai pentru prieteni«
"; }else{ $popmsgbox .= "»Dezactiveaza alertele numai pentru prieteni«
"; } $popmsgbox .= "-----
"; $popmsgbox .= "»Prim«"; } $popmsgbox .= "

"; } return $popmsgbox; } /////////////////////////////////////////////get tid frm post id function gettid_pid1($pid) { $tid = mysql_fetch_array(mysql_query("SELECT tid FROM lib3rtymrc_posts2 WHERE id='".$pid."'")); return $tid[0]; } /////////////////////////////////////////////get tid frm post id function gettid_pid($pid) { $tid = mysql_fetch_array(mysql_query("SELECT tid FROM lib3rtymrc_posts WHERE id='".$pid."'")); return $tid[0]; } ///////////////////////////////////////////is trashed? function istrashed($uid) { $del = mysql_query("DELETE FROM lib3rtymrc_penalties WHERE timeto<'".time()."'"); $not = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_penalties WHERE uid='".$uid."' AND penalty='0'")); if($not[0]>0) { return true; }else{ return false; } } ///////////////////////////////////////////is shielded? function isshield($uid) { $not = mysql_fetch_array(mysql_query("SELECT shield FROM lib3rtymrc_users WHERE id='".$uid."'")); if($not[0]=='1') { return true; }else{ return false; } } ///////////////////////////////////////////Get IP function getip_uid($uid) { $not = mysql_fetch_array(mysql_query("SELECT ipadd FROM lib3rtymrc_users WHERE id='".$uid."'")); return $not[0]; } ///////////////////////////////////////////Get Browser function getbr_uid($uid) { $not = mysql_fetch_array(mysql_query("SELECT browserm FROM lib3rtymrc_users WHERE id='".$uid."'")); return $not[0]; } ///////////////////////////////////////////is trashed? function isbanned($uid) { $del = mysql_query("DELETE FROM lib3rtymrc_penalties WHERE timeto<'".time()."'"); $not = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_penalties WHERE uid='".$uid."' AND (penalty='1' OR penalty='2')")); if($not[0]>0) { return true; }else{ return false; } } ///////////////////////////////////////////is forum banned function isforumban($uid) { $del = mysql_query("DELETE FROM lib3rtymrc_penalties WHERE timeto<'".time()."'"); $not = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_penalties WHERE uid='".$uid."' AND penalty='3'")); if($not[0]>0) { return true; }else{ return false; } } ///////////////////////////////////////////is chat banned function ischatban($uid) { $del = mysql_query("DELETE FROM lib3rtymrc_penalties WHERE timeto<'".time()."'"); $not = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_penalties WHERE uid='".$uid."' AND penalty='4'")); if($not[0]>0) { return true; }else{ return false; } } /////////////////////////////////////////////get tid frm post id function gettname1($tid) { $tid = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_topics2 WHERE id='".$tid."'")); return $tid[0]; } /////////////////////////////////////////////get tid frm post id function gettname($tid) { $tid = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_topics WHERE id='".$tid."'")); return $tid[0]; } /////////////////////////////////////////////get tid frm post id function getfid_tid1($tid) { $fid = mysql_fetch_array(mysql_query("SELECT fid FROM lib3rtymrc_topics2 WHERE id='".$tid."'")); return $fid[0]; } /////////////////////////////////////////////get tid frm post id function getfid_tid($tid) { $fid = mysql_fetch_array(mysql_query("SELECT fid FROM lib3rtymrc_topics WHERE id='".$tid."'")); return $fid[0]; } /////////////////////////////////////////////is ip banned function isipbanned($ipa, $brm) { $pinf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_penalties WHERE penalty='2' AND ipadd='".$ipa."' AND browserm='".$brm."'")); if($pinf[0]>0) { return true; } return false; } ////////////////get number of pinned topics in forum function getpinned1($fid) { $nop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_topics2 WHERE fid='".$fid."' AND pinned ='1'")); return $nop[0]; } ////////////////get number of pinned topics in forum function getpinned($fid) { $nop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_topics WHERE fid='".$fid."' AND pinned ='1'")); return $nop[0]; } /////////////////////////////////////////////can bud? function budres($uid, $tid) { //3 = can't bud //2 = already buds //1 = request pended //0 = can bud if($uid==$tid) { return 3; } if (arebuds($uid, $tid)) { return 2; } $req = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_buddies WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='0'")); if($req[0]>0) { return 1; } $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_buddies WHERE (uid='".$tid."' OR tid='".$tid."') AND agreed='1'")); global $max_buds; if($notb[0]>=$max_buds) { return 3; } $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_buddies WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'")); global $max_buds; if($notb[0]>=$max_buds) { return 3; } return 0; } ////////////////////////////////////////////Session expiry time function getsxtm() { $getdata = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='sesexp'")); return $getdata[0]; } ////////////////////////////////////////////Get bud msg function getbudmsg($uid) { $getdata = mysql_fetch_array(mysql_query("SELECT budmsg FROM lib3rtymrc_users WHERE id='".$uid."'")); return $getdata[0]; } ////////////////////////////////////////////Descriere poza function getgallerymsg($uid) { $getdata = mysql_fetch_array(mysql_query("SELECT comentariu FROM lib3rtymrc_gallery WHERE id='".$uid."'")); return $getdata[0]; } ////////////////////////////////////////////Descriere candidat function getcandidat($uid) { $getdata = mysql_fetch_array(mysql_query("SELECT comentariu FROM lib3rty_justme WHERE id='".$uid."'")); return $getdata[0]; } ////////////////////////////////////////////Get forum name function getfname1($fid) { $fname = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_forums2 WHERE id='".$fid."'")); return $fname[0]; } ////////////////////////////////////////////Get forum name function getfname($fid) { $fname = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_forums WHERE id='".$fid."'")); return $fname[0]; } ////////////////////////////////////////////PM antiflood time function getpmaf() { $getdata = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='pmaf'")); return $getdata[0]; } ////////////////////////////////////////////antiflood mesaje live function getliveaf() { $getdata = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='liveaf'")); return $getdata[0]; } ////////////////////////////////////////////PM antiflood time function getfview() { $getdata = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='fview'")); return $getdata[0]; } ////////////////////////////////////////////get forum message function getfmsg() { $getdata = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='4ummsg'")); return $getdata[0]; } //////////////////////////////////////////////is online function isonline($uid) { $uon = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_online WHERE userid='".$uid."'")); if($uon[0]>0) { return true; }else { return false; } } ///////////////////////////if registration is allowed function canreg() { $getreg = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='reg'")); if($getreg[0]=='1') { return true; }else { return false; } } ///////////////////////////if validation is on function validation() { $getval = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='vldtn'")); if($getval[0]=='1') { return true; }else { return false; } } ///////////////////////////mesaje live activate function mliveon() { $getval = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='mlive'")); if($getval[0]=='1') { return true; }else { return false; } } ///////////////////////////////////////////Get Forum ID function getfid1($topicid) { $fid = mysql_fetch_array(mysql_query("SELECT fid FROM lib3rtymrc_topics2 WHERE id='".$topicid."'")); return $fid[0]; } ///////////////////////////////////////////Get Forum ID function getfid($topicid) { $fid = mysql_fetch_array(mysql_query("SELECT fid FROM lib3rtymrc_topics WHERE id='".$topicid."'")); return $fid[0]; } ////////////////////////////////////////////Parse PM ////anti spam function parsepm($text, $sid="") { $text = htmlspecialchars($text); $sml = mysql_fetch_array(mysql_query("SELECT hvia FROM lib3rtymrc_users WHERE id='".getuid_sid($sid)."'")); if ($sml[0]=="1") { $text = getsmilies($text); } $text = getbbcode($text, $sid); return $text; } function parsepm2($text, $sid="") { $text = htmlspecialchars($text); $sml = mysql_fetch_array(mysql_query("SELECT hvia FROM lib3rtymrc_users WHERE id='".getuid_sid($sid)."'")); if ($sml[0]=="1") { $text = getsmilies($text); } return $text; } function parsepm1($text, $sid="") { $text = htmlspecialchars($text); $sml = mysql_fetch_array(mysql_query("SELECT hvia FROM lib3rtymrc_users WHERE id='".getuid_sid($sid)."'")); if ($sml[0]=="1") { $text = getsmilies($text); } $text = getbbcode1($text, $sid); return $text; } ////////////////////////////////////////////Parse other msgs function parsemsg($text,$sid="") { $text = htmlspecialchars($text); $sml = mysql_fetch_array(mysql_query("SELECT hvia FROM lib3rtymrc_users WHERE id='".getuid_sid($sid)."'")); if ($sml[0]=="1") { $text = getsmilies($text); } $text = getbbcode($text, $sid); return $text; } ///////////////////////////////////////////Is site blocked function isblocked($str,$sender) { if(ismod($sender)) { return false; } $str = str_replace(" ","",$str); $str = strtolower($str); $res = mysql_query("SELECT site FROM lib3rtymrc_blockedsite"); while ($row = mysql_fetch_array($res)) { $sites[] = $row[0]; } for($i=0;$i0) { return true; } } return false; } /////////////////////////////////////////////////////////CONECTATI function addtotrivia($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_onlinetrivia WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO lib3rtymrc_onlinetrivia SET lton='".time()."', uid='".$uid."'"); if(!$res) { mysql_query("UPDATE lib3rtymrc_onlinetrivia SET lton='".time()."' WHERE uid='".$uid."'"); } } //////////////////blocat la trivia function isoprit($str,$sender) { $str = str_replace(" ","",$str); $str = strtolower($str); $res = mysql_query("SELECT browser FROM lib3rtymrc_pc"); while ($row = mysql_fetch_array($res)) { $sites[] = $row[0]; } for($i=0;$i0) { return false; } } return true; } ///////////////////timp function gettime() { $part_time = explode(' ', microtime(7)); $real_time = $part_time[1].substr($part_time[0], 1); return $real_time; } ///////////////////////////////////////////Is browser blocked function isblockedbrowser($var) { $text = $_SERVER['HTTP_USER_AGENT']; $rez = mysql_query("SELECT * FROM lib3rtymrc_blockbrowser"); $i=0; while($row=mysql_fetch_array($rez)) { $var[$i]=$row[1]; $i++; } $result = count($var); for ($i=0;$i<$result;$i++) { $ausg = stristr($text, $var[$i]); if(strlen($ausg)>0) { return true; } } return false; } ///////////////////////////////////////////Is ip blocked function isblockedip($var) { $text = $_SERVER['REMOTE_ADDR']; $rez = mysql_query("SELECT * FROM lib3rtymrc_blockedip"); $i=0; while($row=mysql_fetch_array($rez)) { $var[$i]=$row[1]; $i++; } $result = count($var); for ($i=0;$i<$result;$i++) { $ausg = stristr($text, $var[$i]); if(strlen($ausg)>0) { return true; } } return false; } ///////////////////////////////////////////Is pm starred function isstarred($pmid) { $strd = mysql_fetch_array(mysql_query("SELECT starred FROM lib3rtymrc_private WHERE id='".$pmid."'")); if($strd[0]=="1") { return true; }else{ return false; } } ////////////////////////////////////////////IS LOGGED? function islogged($sid) { //delete old sessions first $deloldses = mysql_query("DELETE FROM lib3rtymrc_ses WHERE expiretm<'".time()."'"); //does sessions exist? $sesx = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_ses WHERE id='".$sid."'")); $sesip= mysql_fetch_array(mysql_query("SELECT ip, bw FROM lib3rtymrc_ses WHERE id='".$sid."'")); $xtm = time() + (getsxtm()*60); mysql_query("UPDATE slaystyle_ses SET expiretm='".$xtm."' WHERE uid='".getuid_nick($uid)."'"); $extxtm = mysql_query("UPDATE lib3rtymrc_ses SET expiretm='".$xtm."' WHERE id='".$sid."'"); $haip=$_SERVER["REMOTE_ADDR"]; $bw=$_SERVER['HTTP_USER_AGENT']; $referal = $_SERVER["HTTP_REFERER"]; $ref=@$HTTP_REFERER; ///////aici setezi protectia cat de pizda sa fie ..adica strong! de la 6 la 10. daca nu sti cum sta treaba las-o asa ..ca merge $primeip=substr("$haip",0,6); $primeip2=substr("$sesip[0]",0,6); //echo $referal.$ref; if($sesx[0]>0) { if(!isuser(getuid_sid($sid))) { return false; } if(($sesip[1]==$bw)and($primeip2==$primeip)) { return true; } else { $ipscos = getip(); $nick = getnick_sid($sid); $ubrs=$_SERVER['HTTP_USER_AGENT']; $referal = $_SERVER["HTTP_REFERER"]; $numetest = numebyip($ipscos); $text = "Ip-ul: $ipscos a incercat sa intre pe sesiunea lui $nick![br/]User suspect: $numetest ----Cu browserul:$ubrs ----Refferer: $referal"; $sql = mysql_query("SELECT id, name FROM lib3rtymrc_users WHERE permxmagic='4'"); while ($id = @mysql_fetch_array($sql)){ mysql_query("INSERT INTO lib3rtymrc_notificare SET text='[b]ALERTA SUSPECTA[/b][br/]".$text."', byuid='0', touid = '1', timesent='".time()."'"); mysql_query("DELETE FROM lib3rtymrc_ses WHERE uid='".getuid_sid($sid)."'"); echo ""; echo "

"; echo "\"*\"/
"; echo "Nu esti autentificat !
Ori sesiunea ta a expirat."; echo "

"; echo "
"; echo ""; exit(); } } //yip it's logged in //first extend its session expirement time $xtm = time() + (60*getsxtm()); $extxtm = mysql_query("UPDATE lib3rtymrc_ses SET expiretm='".$xtm."' WHERE id='".$sid."'"); return true; }else{ //nope its session must be expired or something return false; } }////////////////////////Get user nick from session id function getnick_sid($sid) { $uid = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_ses WHERE id='".$sid."'")); $uid = $uid[0]; return getnick_uid($uid); } ///////////////asta bagi in core function detect($ipscos,$ubr,$sid) { $slay1 = strlen($ubr); $ipnr = htmlspecialchars($ipscos); $ip_nr = substr($ipnr,0,6); $ip = mysql_fetch_array(mysql_query("SELECT ipadd, browserm FROM lib3rtymrc_users where id='".getuid_sid($sid)."'")); $ipnr2 = htmlspecialchars($ip[0]); $ip_nr2 = substr($ipnr2,0,6); $brows = $ip[1]; $slay2 = strlen($brows); if($ip_nr2!=$ip_nr||$slay1!=$slay2) { return TRUE; }else{ return FALSE; } } //////////// function numebyip($ipscos) { $slay = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_users WHERE ipadd='".$ipscos."'")); return $slay[0]; } ////////////////////////Get user id from session id function getuid_sid($sid) { $uid = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_ses WHERE id='".$sid."'")); $uid = $uid[0]; return $uid; } /////////////////////Get total number of pms function getpmcount($uid,$view="all") { if($view=="all"){ $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_private WHERE touid='".$uid."'")); }else if($view =="snt") { $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_private WHERE byuid='".$uid."'")); }else if($view =="str") { $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_private WHERE touid='".$uid."' AND starred='1'")); }else if($view =="urd") { $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_private WHERE touid='".$uid."' AND unread='1'")); } return $nopm[0]; } function deleteClub($clid) { $fid = mysql_fetch_array(mysql_query("SELECT id FROM lib3rtymrc_forums WHERE clubid='".$clid."'")); $fid = $fid[0]; $topics = mysql_query("SELECT id FROM lib3rtymrc_topics WHERE fid=".$fid.""); while($topic = mysql_fetch_array($topics)) { mysql_query("DELETE FROM lib3rtymrc_posts WHERE tid='".$topic[0]."'"); } mysql_query("DELETE FROM lib3rtymrc_topics WHERE fid='".$fid."'"); mysql_query("DELETE FROM lib3rtymrc_forums WHERE id='".$fid."'"); mysql_query("DELETE FROM lib3rtymrc_rooms WHERE clubid='".$clid."'"); mysql_query("DELETE FROM lib3rtymrc_clubmembers WHERE clid='".$clid."'"); mysql_query("DELETE FROM lib3rtymrc_announcements WHERE clid='".$clid."'"); mysql_query("DELETE FROM lib3rtymrc_clubs WHERE id=".$clid.""); return true; } function deleteMClubs($uid) { $uclubs = mysql_query("SELECT id FROM lib3rtymrc_clubs WHERE owner='".$uid."'"); while($uclub=mysql_fetch_array($uclubs)) { deleteClub($uclub[0]); } } //////////////////////Function add user to online list :P function addonline($uid,$place,$plclink) { /////delete inactive users $tm = time(); $online = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='sesexp'")); $online = $online[0]; $timeout = $tm - $online; $deloff = mysql_query("DELETE FROM lib3rtymrc_online WHERE actvtime <'".$timeout."'"); ///now try to add user to online list $res = mysql_query("UPDATE lib3rtymrc_users SET lastact='".time()."' WHERE id='".$uid."'"); $nume = mysql_fetch_array(mysql_query("SELECT name, sex FROM lib3rtymrc_users WHERE id='".$uid."'")); $res = mysql_query("INSERT INTO lib3rtymrc_online SET userid='".$uid."', actvtime='".$tm."', sex='".$nume[1]."', place='".$place."', placedet='".$plclink."'"); if(!$res) { //most probably userid already in the online list //so just update the place and time $res = mysql_query("UPDATE lib3rtymrc_online SET actvtime='".$tm."', place='".$place."', sex='".$nume[1]."', placedet='".$plclink."' WHERE userid='".$uid."'"); } $maxmem=mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE id='2'")); $result = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_online")); if($result[0]>=$maxmem[0]) { $tnow = date("D d M Y - H:i"); mysql_query("UPDATE lib3rtymrc_settings set name='".$tnow."', value='".$result[0]."' WHERE id='2'"); } $maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM lib3rtymrc_mpot WHERE ddt='".date("d m y")."'")); if($maxtoday[0]==0||$maxtoday=="") { mysql_query("INSERT INTO lib3rtymrc_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'"); $maxtoday[0]=1; } if($result[0]>=$maxtoday[0]) { mysql_query("UPDATE lib3rtymrc_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'"); } } /////////////////////Get members online function getnumonline() { $nouo = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_online ")); return $nouo[0]; } function iaconbaieti() { $conectbaieti = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_online WHERE sex='M'")); return $conectbaieti[0]; } function iaconfete() { $conectfete = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_online WHERE sex='F'")); return $conectfete[0]; } //////////////////////////////////////is ignored function isignored($tid, $uid) { $ign = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_ignore WHERE target='".$tid."' AND name='".$uid."'")); if($ign[0]>0) { return true; } return false; } ///////////////////////////////////////////GET IP /* function getip() { if (getenv('HTTP_X_FORWARDED_FOR')) { $ip=getenv('HTTP_X_FORWARDED_FOR'); } else { $ip=getenv('REMOTE_ADDR'); } return $ip; } */ function GetIP() { if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) $ip = getenv("HTTP_CLIENT_IP"); else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) $ip = getenv("HTTP_X_FORWARDED_FOR"); else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) $ip = getenv("REMOTE_ADDR"); else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) $ip = $_SERVER['REMOTE_ADDR']; else $ip = "Necunoscut"; return($ip); } //////////////////////////////////////////ignore result function ignoreres($uid, $tid) { //0 user can't ignore the target //1 yes can ignore //2 already ignored if($uid==$tid) { return 0; } if(ismod($tid)) { //you cant ignore staff members return 0; } if(arebuds($tid, $uid)) { //why the hell would anyone ignore his bud? o.O return 0; } if(isignored($tid, $uid)) { return 2; // the target is already ignored by the user } return 1; } ///////////////////////////////////////////Function getage function getage($strdate) { $dob = explode("-",$strdate); if(count($dob)!=3) { return 0; } $y = $dob[0]; $m = $dob[1]; $d = $dob[2]; if(strlen($y)!=4) { return 0; } if(strlen($m)!=2) { return 0; } if(strlen($d)!=2) { return 0; } $y += 0; $m += 0; $d += 0; if($y==0) return 0; $rage = date("Y") - $y; if(date("m")<$m) { $rage-=1; }else{ if((date("m")==$m)&&(date("d")<$d)) { $rage-=1; } } return $rage; } /////////////////////////////////////////getavatar function getavatar($uid) { $av = mysql_fetch_array(mysql_query("SELECT avatar FROM lib3rtymrc_users WHERE id='".$uid."'")); return $av[0]; } /////////////////////////////////////////Can see details? function cansee($uid, $tid) { if($uid==$tid) { return true; } if(ismod($uid)) { return true; } return false; } //////////////////////////gettimemsg function gettimemsg($sec) { $years=0; $months=0; $weeks=0; $days=0; $mins=0; $hours=0; if ($sec>59) { $secs=$sec%60; $mins=$sec/60; $mins=(integer)$mins; } if ($mins>59) { $hours=$mins/60; $hours=(integer)$hours; $mins=$mins%60; } if ($hours>23) { $days=$hours/24; $days=(integer)$days; $hours=$hours%24; } if ($days>6) { $weeks=$days/7; $weeks=(integer)$weeks; $days=$days%7; } if ($weeks>3) { $months=$weeks/4; $months=(integer)$months; $weeks=$weeks%4; } if ($months>11) { $years=$months/12; $years=(integer)$years; $months=$months%12; } if($years>0) { if($years==1){$yearmsg="an";}else{$yearmsg="ani";} if($months==1){$monthsmsg="luna";}else{$monthsmsg="luni";} if($days==1){$daysmsg="zi";}else{$daysmsg="zile";} if($hours==1){$hoursmsg="ora";}else{$hoursmsg="ore";} if($mins==1){$minsmsg="minut";}else{$minsmsg="minute";} if($secs==1){$secsmsg="secunda";}else{$secsmsg="secunde";} if($months!=0){$monthscheck="$months $monthsmsg ";}else{$monthscheck="";} if($days!=0){$dayscheck="$days $daysmsg ";}else{$dayscheck="";} if($hours!=0){$hourscheck="$hours $hoursmsg ";}else{$hourscheck="";} if($minutes!=0){$minscheck="$mins $minsmsg ";}else{$minscheck="";} if($secs!=0){$secscheck="$secs $secsmsg";}else{$secscheck="";} return "$years $yearmsg $monthscheck$dayscheck$hourscheck$minscheck$secscheck"; } if(($years<1)&&($months>0)) { if($months==1){$monthsmsg="luna";}else{$monthsmsg="luni";} if($days==1){$daysmsg="zi";}else{$daysmsg="zile";} if($hours==1){$hoursmsg="ora";}else{$hoursmsg="ore";} if($mins==1){$minsmsg="minut";}else{$minsmsg="minute";} if($secs==1){$secsmsg="secunda";}else{$secsmsg="secunde";} if($days!=0){$dayscheck="$days $daysmsg ";}else{$dayscheck="";} if($hours!=0){$hourscheck="$hours $hoursmsg ";}else{$hourscheck="";} if($minutes!=0){$minscheck="$mins $minsmsg ";}else{$minscheck="";} if($secs!=0){$secscheck="$secs $secsmsg";}else{$secscheck="";} return "$months $monthsmsg $dayscheck$hourscheck$minscheck$secscheck"; } if(($months<1)&&($weeks>0)) { if($weeks==1){$weeksmsg="saptamana";}else{$weeksmsg="saptamani";} if($days==1){$daysmsg="zi";}else{$daysmsg="zile";} if($hours==1){$hoursmsg="ora";}else{$hoursmsg="ore";} if($mins==1){$minsmsg="minut";}else{$minsmsg="minute";} if($secs==1){$secsmsg="secunda";}else{$secsmsg="secunde";} if($days!=0){$dayscheck="$days $daysmsg ";}else{$dayscheck="";} if($hours!=0){$hourscheck="$hours $hoursmsg ";}else{$hourscheck="";} if($minutes!=0){$minscheck="$mins $minsmsg ";}else{$minscheck="";} if($secs!=0){$secscheck="$secs $secsmsg";}else{$secscheck="";} return "$weeks $weeksmsg $dayscheck$hourscheck$minscheck$secscheck"; } if(($weeks<1)&&($days>0)) { if($days==1){$daysmsg="zi";}else{$daysmsg="zile";} if($hours==1){$hoursmsg="ora";}else{$hoursmsg="ore";} if($mins==1){$minsmsg="minut";}else{$minsmsg="minute";} if($secs==1){$secsmsg="secunda";}else{$secsmsg="secunde";} if($hours!=0){$hourscheck="$hours $hoursmsg ";}else{$hourscheck="";} if($minutes!=0){$minscheck="$mins $minsmsg ";}else{$minscheck="";} if($secs!=0){$secscheck="$secs $secsmsg";}else{$secscheck="";} return "$days $daysmsg $hourscheck$minscheck$secscheck"; } if(($days<1)&&($hours>0)) { if($hours==1){$hoursmsg="ora";}else{$hoursmsg="ore";} if($mins==1){$minsmsg="minut";}else{$minsmsg="minute";} if($secs==1){$secsmsg="secunda";}else{$secsmsg="secunde";} if($minutes!=0){$minscheck="$mins $minsmsg ";}else{$minscheck="";} if($secs!=0){$secscheck="$secs $secsmsg";}else{$secscheck="";} return "$hours $hoursmsg $minscheck$secscheck"; } if(($hours<1)&&($mins>0)) { if($mins==1){$minsmsg="minut";}else{$minsmsg="minute";} if($secs==1){$secsmsg="secunda";}else{$secsmsg="secunde";} if($secs!=0){$secscheck="$secs $secsmsg";}else{$secscheck="";} return "$mins $minsmsg $secscheck"; } if(($mins<1)&&($sec>0)) { if($sec==1){$secsmsg="secunda";}else{$secsmsg="secunde";} if($sec!=0){$secscheck="$sec $secsmsg";}else{$secscheck="";} return "$secscheck"; } } ///////////////////////////////////////// reputatia function getreputatie($uid) { $info= mysql_fetch_array(mysql_query("SELECT chmsgs FROM lib3rtymrc_users WHERE id='".$uid."'")); if($info[0]<100) { return "\".\"/"; }else if($info[0]<500) { return "\".\"/"; }else if($info[0]<1000) { return "\".\"/\".\"/"; }else if($info[0]<1500) { return "\".\"/\".\"/"; }else if($info[0]<3000) { return "\".\"/\".\"/\".\"/"; }else if($info[0]<5000) { return "\".\"/\".\"/\".\"/"; }else if($info[0]<7000) { return "\".\"/\".\"/\".\"/\".\"/"; }else if($info[0]<9000) { return "\".\"/\".\"/\".\"/\".\"/"; }else if($info[0]<10000) { return "\".\"/\".\"/\".\"/\".\"/\".\"/"; }else { return "\".\"/\".\"/\".\"/\".\"/\".\"/"; } } /////////////////////////////////////////get status /////////////////////////////////////////Statutu function getstatus($uid) { $info= mysql_fetch_array(mysql_query("SELECT permxmagic, plusses FROM lib3rtymrc_users WHERE id='".$uid."'")); if(isbanned($uid)) { return "Banat(a)!"; } if($info[0] > 0 && $info[0]<'11') { return ' Echipa MagicWorld'; }else if($info[0]=='0'||$info[0]=='11'){ if($info[1]<10) { return "Abia sosit(a)"; }else if($info[1]<50) { return "Nou venit(a)"; }else if($info[1]<125) { return "Membru"; }else if($info[1]<500) { return "Avansat(a)"; }else if($info[1]<4000) { return "Fidel(a)"; }else if($info[1]<6000) { return "Super Star"; }else if($info[1]<10000) { return "The BesT"; }else { return "$numesite-V.I.P"; } } } /////////////////////////////////////////Simboluri function getsimbol($uid) { $info= mysql_fetch_array(mysql_query("SELECT permxmagic, plusses, icon FROM lib3rtymrc_users WHERE id='".$uid."'")); if(isbanned($uid)) { return "(x)"; } if(!empty($info[2]) && $info[0]>0){ return ""; }elseif(empty($info[2]) && $info[0] >'0' && $info[0]<'11'){ return ""; }else{ if($info[1]<10) { return "."; }else if($info[1]<50) { return "+"; }else if($info[1]<125) { return "*"; }else if($info[1]<500) { return "ª"; }else if($info[1]<4000) { return "±"; }else if($info[1]<6000) { return "§"; }else if($info[1]<10000) { return ":D"; }else { return "¤"; } } } /////////////////////Get Page Jumber function getjumper($action, $sid,$pgurl) { $rets = "
"; $rets .= "pagina"; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= "
"; return $rets; } /////////////////////Get unread number of pms function getunreadpm($uid) { $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_private WHERE touid='".$uid."' AND unread='1'")); return $nopm[0]; } //////////////////////GET USER NICK FROM USERID function getnick_uid($uid) { $unick = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_users WHERE id='".$uid."'")); return $unick[0]; } ///////////////////////////////////////////////Get the smilies function getsmilies($text) { $sql = "SELECT * FROM lib3rtymrc_smilies"; $smilies = mysql_query($sql); while($smilie=mysql_fetch_array($smilies)) { $scode = $smilie[1]; $spath = $smilie[2]; $text = str_replace($scode,"\"$scode\"/",$text); } return $text; } ////////////////////////////////////////////check nicks function checknick($aim) { $chk =0; $aim = strtolower($aim); $nicks = mysql_query("SELECT id, name, nicklvl FROM lib3rtymrc_nicks"); while($nick=mysql_fetch_array($nicks)) { if($aim==$nick[1]) { $chk = $nick[2]; }else if(substr($aim,0,strlen($nick[1]))==$nick[1]) { $chk = $nick[2]; }else{ $found = strpos($aim, $nick[1]); if($found!=0) { $chk = $nick[2]; } } } return $chk; } ///////////////////////////if accepts auto msgs function automsgs($uid) { $getval = mysql_fetch_array(mysql_query("SELECT automsgs FROM lib3rtymrc_users WHERE id='".$uid."'")); if($getval[0]=='1') { return true; }else { return false; } } /////////////////////// auto pm function autopm($msg, $who) { mysql_query("INSERT INTO lib3rtymrc_notificare SET text='".$msg."', byuid='0', touid='".$who."', unread='1', timesent='".time()."'"); } /////////////////////// auto pm function pmautomat($msg, $who) { mysql_query("INSERT INTO lib3rtymrc_notificare SET text='".$msg."', byuid='0', touid='".$who."', unread='1', timesent='".time()."'"); } ////////////////////////////////////////////////////Register function register($name,$pass,$usex,$day,$month,$year,$uloc,$email,$info, $ubr, $cod) { $execms = mysql_query("SELECT * FROM lib3rtymrc_users WHERE name='".$name."';"); if (mysql_num_rows($execms)>0){ return 1; }else{ $pass = md5($pass); $validation = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='vldtn'")); if($validation[0]==1) { $validated=0; }else{ $validated=1; } $reg = mysql_query("INSERT INTO lib3rtymrc_users SET name='".$name."', pass='".$pass."', birthday='".$year.$month.$day."', sex='".$usex."', location='".$uloc."', email='".$email."', signature='".$info."', regdate='".time()."', validated='".$validated."', ipadd='".getip()."', browserm='".$ubr."', codrecuperare='".$cod."'"); if ($reg) { $uid = getuid_nick($name); addonline($uid,"Inregistrare",""); $delonline = mysql_query("DELETE FROM lib3rtymrc_online WHERE userid='".$uid."'"); $uid = mysql_fetch_array(mysql_query("SELECT id FROM lib3rtymrc_users WHERE name='".$name."'")); $sitename = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='sitename'")); $msg = "Salu'tare /reader intreaga echipa a siteului $numesite iti ureaza bun venit.ura., ne bucuram ca ai ales chat-ul nostru si speram sa te simti cat mai bine aici.love., daca ai orice problema legata de site nu ezita sa ceri asistenta unui membru al echipei;) si nu uita sa zici tuturor de noi!.ura.[br/][small][i]P.S.:acesta este un pm automat nu raspunde-ti la el.:)[/i][/small]"; $msg = mysql_escape_string($msg); autopm($msg, $uid[0]); return 0; }else{ return 2; } } } function getuid_nick($nick) { $uid = mysql_fetch_array(mysql_query("SELECT id FROM lib3rtymrc_users WHERE name='".$nick."'")); return $uid[0]; } function isowner1($uid) { $admn = mysql_fetch_array(mysql_query("SELECT permxmagic, OK_TEAM FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='4' && $admn[1]=='1') { return TRUE; }else{ return FALSE; } } /////////////////////////////////////////Is admin sef? function isowner($uid) { $admn = mysql_fetch_array(mysql_query("SELECT permxmagic, OK_TEAM FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='3' && $admn[1]=='1') { return TRUE; }else{ return FALSE; } } /////////////////////////////////////////Is admin? function isadmin($uid) { $admn = mysql_fetch_array(mysql_query("SELECT permxmagic, OK_TEAM FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='2' && $admn[1]=='1') { return true; }else{ return false; } } function isadminsef($uid) { $admn = mysql_fetch_array(mysql_query("SELECT permxmagic, OK_TEAM FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='3' && $admn[1]=='1') { return true; }else{ return false; } } /////////////////////////////////////////Is moderator? function ismoderator($uid) { $admn = mysql_fetch_array(mysql_query("SELECT permxmagic, OK_TEAM FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1' && $admn[1]=='1') { return true; }else{ return false; } } /////////////////////////////////////////baneaza function isban($uid) { $admn = mysql_fetch_array(mysql_query("SELECT ban FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } /////////////////////////////////////////baneaza ip function isbanip($uid) { $admn = mysql_fetch_array(mysql_query("SELECT banip FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } /////////////////////////////////////////baneaza chat forum function isbanchatforum($uid) { $admn = mysql_fetch_array(mysql_query("SELECT banchatforum FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } /////////////////////////////////////////arunca function isarunca($uid) { $admn = mysql_fetch_array(mysql_query("SELECT arunca FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } ////////////////////////////////////////valideaza function isvalideaza($uid) { $admn = mysql_fetch_array(mysql_query("SELECT validari FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } ////////////////////////////////////////debaneaza function isdebaneaza($uid) { $admn = mysql_fetch_array(mysql_query("SELECT debaneaza FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } ////////////////////////////////////////vizualiazeaza actiuni si rapoparte function isactiunir($uid) { $admn = mysql_fetch_array(mysql_query("SELECT actiunir FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } ////////////////////////////////////////sterge forum si mes live function isdforums($uid) { $admn = mysql_fetch_array(mysql_query("SELECT dforum FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } ////////////////////////////////////////////////////////CONECTATI quizz function adaugaquiz($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM n3s_conectquiz WHERE ultconect<'".$timeout."'"); $res = mysql_query("INSERT INTO n3s_conectquiz SET ultconect='".time()."', cine='".$uid."'"); if(!$res) { mysql_query("UPDATE n3s_conectquiz SET ultconect='".time()."' WHERE cine='".$uid."'"); } } ///////////////////////////////////parse bbcode function getbbcode($text, $sid="") { /* $text=preg_replace("/\[b\](.*?)\[\/b\]/i","\\1", $text); $text=preg_replace("/\[i\](.*?)\[\/i\]/i","\\1", $text); $text=preg_replace("/\[u\](.*?)\[\/u\]/i","\\1", $text); $text=preg_replace("/\[big\](.*?)\[\/big\]/i","\\1", $text); $text=preg_replace("/\[small\](.*?)\[\/small\]/i","\\1", $text); $text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","$2",$text); $text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","$2",$text); $text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","$2",$text); $text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\]/is","$2",$text); */ $text = preg_replace("/\[user\=(.*?)\](.*?)\[\/user\]/is","$2",$text); $text = preg_replace("/\[forum\=(.*?)\](.*?)\[\/forum\]/is","$2",$text); $text = preg_replace("/\[pet](.*?)\[\/pet\]/is","Hraneste-mi Animalutzul",$text); $text = preg_replace("/\[pet\=(.*?)\](.*?)\[\/pet\]/is","$2",$text); $text = preg_replace("/\[fcat\=(.*?)\](.*?)\[\/fcat\]/is","$2",$text); $text=preg_replace("/\[rosu\](.*?)\[\/rosu\]/i","\\1", $text); $text=preg_replace("/\[b\](.*?)\[\/b\]/i","\\1", $text); $text=preg_replace("/\[i\](.*?)\[\/i\]/i","\\1", $text); $text=preg_replace("/\[u\](.*?)\[\/u\]/i","\\1", $text); $text=preg_replace("/\[big\](.*?)\[\/big\]/i","\\1", $text); $text=preg_replace("/\[small\](.*?)\[\/small\]/i","\\1", $text); $text = preg_replace("/\[site\=(.*?)\](.*?)\[\/site\]/is","$2",$text); $text = preg_replace("/\[poza\=(.*?)\](.*?)\[\/poza\]/is","\"$2\"/",$text); $text = preg_replace("/\[gal\=(.*?)\](.*?)\[\/gal\]/is","$2",$text); $text = str_replace('Avioanele', "Avioanele", $text); // dedicatie $text = preg_replace("/\[dedicatie\=(.*?)\](.*?)\[\/dedicatie\]/is","$2",$text); // bb nr de tel $text = preg_replace("/\[nr\=(.*?)\](.*?)\[\/nr\]/is","$2",$text); // $text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","$2",$text); $text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","$2",$text); $text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\]/is","$2",$text); //$text = ereg_replace("http://[A-Za-z0-9./=?-_]+","\\0", $text); if(substr_count($text,"[br/]")<=3){ $text = str_replace("[br/]","
",$text); } $text = preg_replace("/\[mss\=(.*?)\](.*?)\[\/mss\]/is","\"$2\"/",$text); // download $text = preg_replace("/\[download\=(.*?)\](.*?)\[\/download\]/is","$2",$text); $text = preg_replace("/\[dcat\=(.*?)\](.*?)\[\/dcat\]/is","$2",$text); //======================== $text = preg_replace("/\[pet](.*?)\[\/pet\]/is","Hraneste-mi animalutzul!",$text); //======================== ///////////scurtaturi $text = preg_replace("/\[catre\=FORUM\]/is","Forum",$text); $text = preg_replace("/\[catre\=POSTA\]/is","Posta",$text); $text = preg_replace("/\[catre\=ALBUM\]/is","Galerie",$text); $text = preg_replace("/\[catre\=DOWNLOAD\]/is","Download",$text); $text = preg_replace("/\[catre\=NOROC\]/is","Jocuri de Noroc",$text); $text = preg_replace("/\[catre\=EXTRA\]/is","Meniu Extra",$text); $text = preg_replace("/\[catre\=SETARI\]/is","Meniu Extra",$text); $text = preg_replace("/\[BB\]/is","Coduri BB",$text); /////////// $text = str_replace("hifi","expiratii",$text); $text = str_replace("Hifi","expiratii",$text); $text = str_replace("hi-fi","expiratii",$text); $text = str_replace("shady","copil tampit",$text); $text = str_replace("tushady","copil tampit",$text); $text = str_replace("pizde","britneyspears",$text); $text = str_replace("tzigan","britneyspears",$text); $text = str_replace("cacat","britneyspears",$text); $text = str_replace("jegoasa","britneyspears",$text); $text = str_replace("jegos","britneyspears",$text); $text = str_replace("sugi","daca mar auzi mama...",$text); $text = str_replace("rapanos","britneyspears",$text); $text = str_replace("serady","om fara ocupatie",$text); $text = str_replace("lord","batut de soarta",$text); $text = str_replace("ny.ky","zarzavat",$text); $text = str_replace("hH4U","britneyspears",$text); $text = str_replace("HH4u","britneyspears",$text); $text = str_replace("hh4U","britneyspears",$text); return $text; } function getbbcode1($text, $sid="") { $text=preg_replace("/\[b\](.*?)\[\/b\]/i","\\1", $text); $text=preg_replace("/\[i\](.*?)\[\/i\]/i","\\1", $text); $text=preg_replace("/\[u\](.*?)\[\/u\]/i","\\1", $text); $text=preg_replace("/\[big\](.*?)\[\/big\]/i","\\1", $text); $text=preg_replace("/\[small\](.*?)\[\/small\]/i","\\1", $text); $text = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","$2",$text); $text = preg_replace("/\[poza\=(.*?)\](.*?)\[\/poza\]/is","\"$2\"/",$text); $text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","$2",$text); $text = preg_replace("/\[galerie\=(.*?)\](.*?)\[\/galerie\]/is","$2",$text); $text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","$2",$text); $text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\]/is","$2",$text); //$text = ereg_replace("http://[A-Za-z0-9./=?-_]+","\\0", $text); if(substr_count($text,"[br/]")<=3){ $text = str_replace("[br/]","
",$text); } $text = str_replace("hifi","expiratii",$text); $text = str_replace("Hifi","expiratii",$text); $text = str_replace("hi-fi","expiratii",$text); $text = str_replace("shady","copil tampit",$text); $text = str_replace("tushady","copil tampit",$text); $text = str_replace("pizde","britneyspears",$text); $text = str_replace("tzigan","britneyspears",$text); $text = str_replace("cacat","britneyspears",$text); $text = str_replace("jegoasa","britneyspears",$text); $text = str_replace("jegos","britneyspears",$text); $text = str_replace("sugi","britneyspears",$text); $text = str_replace("rapanos","britneyspears",$text); $text = str_replace("hh4u","britneyspears",$text); $text = str_replace("HH4U","britneyspears",$text); $text = str_replace("Hh4u","britneyspears",$text); $text = str_replace("hH4U","britneyspears",$text); $text = str_replace("HH4u","britneyspears",$text); $text = str_replace("hh4U","britneyspears",$text); return $text; } //////////////////////////////////////////////////MISC FUNCTIONS function spacesin($word) { $pos = strpos($word," "); if($pos === false) { return false; }else { return true; } } /////////////////////////////////Number of registered members function regmemcount() { $rmc = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_users")); return $rmc[0]; } /////// function poatequiz($uid) { $valida4 = mysql_fetch_array(mysql_query("SELECT permxmagic, quiz FROM lib3rtymrc_users WHERE id='".$uid."'" /* AND quiz='1'"*/)); if(/*($valida4[1]=='1')&&*/($valida4[0]>'0')) { return true; }else{ return false; } } ///////////////////////////function counter function addvisitor() { $cc = mysql_fetch_array(mysql_query("SELECT value FROM lib3rtymrc_settings WHERE name='Counter'")); $cc = $cc[0]+1; $res = mysql_query("UPDATE lib3rtymrc_settings SET value='".$cc."' WHERE name='Counter'"); } function scharin($word) { $chars = "abcdefghijklmnopqrstuvwxyz0123456789-_"; for($i=0;$i"; $bet = mysql_fetch_array(mysql_query("SELECT bet FROM lib3rtymrc_rpg WHERE code='".$check."'")); $bets = $bet[0]; echo "Invitatie la RPG
Salut ".getnick_uid($uid)." esti invitat la un joc de RPG d catre ".getnick_uid($count[0])." care a pus $bets game plus in joc"; echo "
»Accepta
"; echo "»Refuza
"; } } //////////// function stergeanunt($uid, $item) { $candoit = mysql_fetch_array(mysql_query("SELECT uid FROM xmaxro_matrimoniale WHERE id='".$item."'")); if($uid==$candoit[0]||pozealbum($uid)) { return true; } return false; } //////////////////////////////////////////verbals function uverbs($no) { if($no==0) $utext = "Slapped
and fell down..."; if($no==1) $utext = "Slapped
and fell down..."; if($no==2) $utext = "swing and Kicked...."; if($no==3) $utext = "Jumped and swing the weapon...."; if($no==4) $utext = "Feel Something Wrong.
howled and jumped...."; if($no==5) $utext = "Punched hard.
howled...."; if($no==6) $utext = "Punched Hard.
howled...."; if($no==7) $utext = "Poked the eyes with the weapon..."; if($no==8) $utext = "Jumped and Kicked...."; if($no==9) $utext = "slashed with the weapon...."; if($no==10) $utext = " howled and punched...."; if($no==11) $utext = "Kicked On ass
to down on earth..."; if($no==12) $utext = "gave a bite ear attack"; if($no==13) $utext = "roared with a poisonous kiss"; if($no==14) $utext = "gave a killi killi killer kind aTTaCK"; if($no==15) $utext = "swinged 360 degree with a back stab"; if($no==16) $utext = "blowed a sundot with the weapon"; if($no==17) $utext = "blowed a sonic blow with the weapon"; if($no==18) $utext = "blowed a sonic blow with the weapon"; return $utext; } function addtotrivia2($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_onlinetrivia2 WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO lib3rtymrc_onlinetrivia2 SET lton='".time()."', uid='".$uid."'"); if(!$res) { mysql_query("UPDATE lib3rtymrc_onlinetrivia2 SET lton='".time()."' WHERE uid='".$uid."'"); } } function addtotrivia3($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_onlinetrivia3 WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO lib3rtymrc_onlinetrivia3 SET lton='".time()."', uid='".$uid."'"); if(!$res) { mysql_query("UPDATE lib3rtymrc_onlinetrivia3 SET lton='".time()."' WHERE uid='".$uid."'"); } } function addtofazan($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_onlinefazan WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO lib3rtymrc_onlinefazan SET lton='".time()."', uid='".$uid."'"); if(!$res) { mysql_query("UPDATE lib3rtymrc_onlinefazan SET lton='".time()."' WHERE uid='".$uid."'"); } } function addtorevers($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_onlinerevers WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO lib3rtymrc_onlinerevers SET lton='".time()."', uid='".$uid."'"); if(!$res) { mysql_query("UPDATE lib3rtymrc_onlinerevers SET lton='".time()."' WHERE uid='".$uid."'"); } } function validare($uid) { $not = mysql_fetch_array(mysql_query("SELECT validated FROM lib3rtymrc_users WHERE id='".$uid."'")); if($not[0]=='1') { return true; }else { return false; } } function addtosmart($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM ice_onlinesmart WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO ice_onlinesmart SET lton='".time()."', uid='".$uid."'"); if(!$res) { mysql_query("UPDATE ice_onlinesmart SET lton='".time()."' WHERE uid='".$uid."'"); } } function addtospanzr($uid) { $timeto = 450; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM ice_onlinespanzr WHERE lton<'".$timeout."'"); $res = mysql_query("INSERT INTO ice_onlinespanzr SET lton='".time()."', uid='".$uid."'"); if(!$res) { mysql_query("UPDATE ice_onlinespanzr SET lton='".time()."' WHERE uid='".$uid."'"); } } function accpart($uid) { $info= mysql_fetch_array(mysql_query("SELECT accesari FROM wapnew_parteneri WHERE id='".$uid."'")); if($info[0]<10) { return "\".\"/"; }else if($info[0]<20) { return "\".\"/"; }else if($info[0]<30) { return "\".\"/\".\"/"; }else if($info[0]<40) { return "\".\"/\".\"/"; }else if($info[0]<50) { return "\".\"/\".\"/\".\"/"; }else if($info[0]<60) { return "\".\"/\".\"/\".\"/"; }else if($info[0]<70) { return "\".\"/\".\"/\".\"/\".\"/"; }else if($info[0]<80) { return "\".\"/\".\"/\".\"/\".\"/"; }else if($info[0]<90) { return "\".\"/\".\"/\".\"/\".\"/\".\"/"; }else { return "\".\"/\".\"/\".\"/\".\"/\".\"/"; } } /////////////////////////////////////////Statutus trivia function trivia($uid) { $info= mysql_fetch_array(mysql_query("SELECT trivia, sex FROM lib3rtymrc_users WHERE id='".$uid."'")); if(isbanned($uid)) { return "Banat(a)!"; } if($info[0]<1000) { return "Sunt bata,nu stiu nimic"; }else if($info[0]<1000) { return "Am citit putin,mai mult le nimieresc"; }else if($info[0]<10000) { return "A inceput sa-mi placa,mai am de nimerit"; }else if($info[0]<15000) { return "Cred ca am citit ... reviste"; }else if($info[0]<40000) { return "In mod sigur,am invatat la scoala"; }else if($info[0]<70000) { return "Sunt olimpic,stiu prea multe"; }else if($info[0]<80000) { return "Sunt prea bun .... TriviaKing"; }else { return "Sunt printre cel mai bun membru al IceTriviei"; } } ////////// function geteuromilionari($uid) { $euroscorpionwap = mysql_fetch_array(mysql_query("SELECT iepurasi FROM lib3rtymrc_users WHERE id='".$uid."'")); return $euroscorpionwap[0]; } /////////////////////no pet? function nopet($uid) { $nopet = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ByBaltita_tamagotchi WHERE uid='".$uid."'")); if($nopet[0]=='0') { return false; }else{ return true; } } ////////////////////////////////// function petexist($name) { $checkpet = mysql_fetch_array(mysql_query("SELECT COUNT(*) from ByBaltita_tamagotchi where name='".$name."'")); if($checkpet[0]>0) { return true; }else{ return false; } } /////////////////////Get Challenge function battling($uid) { $nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ByBaltita_duel WHERE touid='".$uid."' AND accept='1'")); return $nopop[0]; } //////////////////////is in game? function battle($uid) { $unick = mysql_fetch_array(mysql_query("SELECT uid FROM ByBaltita_battle WHERE uid='".$uid."'")); return $unick[0]; } /////////////////////Challenge Not yet Accepted function is3($uid) { $nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ByBaltita_duel WHERE byuid='".$uid."' AND accept='1'")); return $nopop[0]; } /////////////////////Challenge Accepted function is2($uid) { $nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ByBaltita_duel WHERE byuid='".$uid."' AND accept='2'")); return $nopop[0]; } /////////////////////////////////////////GET PENDING GAME function pend($uid) { $res = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ByBaltita_battle WHERE uid='".$uid."'")); if($res[0]>0) { return true; } return false; } ///////////////////////////////////////////RPG turn function tiranako($uid) { $not = mysql_fetch_array(mysql_query("SELECT hitter FROM dk_users WHERE id='".$uid."'")); if($not[0]=='1') { return true; }else{ return false; } } /////////////////////turn for RPG function tirana($uid) { $nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM dk_users WHERE id='".$uid."' AND hitter='0'")); return $nopop[0]; } //////////////////////////////////////////can hit? function ewan($uid) { $not = mysql_fetch_array(mysql_query("SELECT hitter FROM dk_users WHERE id='".$uid."'")); if($not[0]=='3') { return true; }else{ return false; } } /////////////////////Get pops function petinfo() { $nopop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ByBaltita_duel")); return $nopop[0]; } /////////////////////Get pops function petinfo2($id) { $nopop = mysql_fetch_array(mysql_query("SELECT hit FROM ByBaltita_battle WHERE id='".$id."'")); if($nopop=='1') { return true; }else{ return false; } } ///////////////////////////////////////////scolari function isscoalaonline($uid) { $not = mysql_fetch_array(mysql_query("SELECT scoalaonline FROM dk_users WHERE id='".$uid."'")); if($not[0]=='1') { return true; }else{ return false; } } ///////////////////////////////////////////scorari function isnoscoalaonline($uid) { $not = mysql_fetch_array(mysql_query("SELECT scoalaonline FROM dk_users WHERE id='".$uid."'")); if($not[0]=='0') { return true; }else{ return false; } } ///////////////////////////////////////////profesori function isprof($uid) { $not = mysql_fetch_array(mysql_query("SELECT prof FROM dk_users WHERE id='".$uid."'")); if($not[0]=='1') { return true; }else{ return false; } } ///////////////////////////////////////////profesori function isnoprof($uid) { $not = mysql_fetch_array(mysql_query("SELECT prof FROM dk_users WHERE id='".$uid."'")); if($not[0]=='0') { return true; }else{ return false; } } ///////////////// function onlchef($uid) { $getdata = mysql_fetch_array(mysql_query("SELECT onlchef FROM dk_users WHERE id='".$uid."'")); return $getdata[0]; } //////////////////////////////////////////////// /////////////////////////////////function get n. of amanti function getnamanti($uid) { $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM dk_amanti WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'")); return $notb[0]; } /////////////////////////////get no. of requists amanti function getnreqsamanti($uid) { $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM dk_amanti WHERE tid='".$uid."' AND agreed='0'")); return $notb[0]; } /////////////////////////////get no. of online buds function getonamanti($uid) { $counter =0; $buds = mysql_query("SELECT uid, tid FROM dk_amanti WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'"); while($bud=mysql_fetch_array($buds)) { if($bud[0]==$uid) { $tid = $bud[1]; }else{ $tid = $bud[0]; } if(isonline($tid)) { $counter++; } } return $counter; } /////////////////////////////////////////////sunteti amanti? function areamanti($uid, $tid) { $res = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM dk_amanti WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='1'")); if($res[0]>0) { return true; } return false; } /////////////////////////////////////////////can bud amanti? function amantires($uid, $tid) { //3 = can't bud //2 = already buds //1 = request pended //0 = can bud if($uid==$tid) { return 3; } if (areamanti($uid, $tid)) { return 2; } $req = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM dk_amanti WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='0'")); if($req[0]>0) { return 1; } $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM dk_amanti WHERE (uid='".$tid."' OR tid='".$tid."') AND agreed='1'")); global $max_buds; if($notb[0]>=$max_buds) { return 3; } $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM dk_amanti WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'")); global $max_buds; if($notb[0]>=$max_buds) { return 3; } return 0; } ///////////////////////////////// //////////////////////////////////////is urmarit function isignore($tid, $uid) { $ign = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_urmariti WHERE target='".$tid."' AND name='".$uid."'")); if($ign[0]>0) { return true; } return false; } //////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////// ////////////////////////////pm la useri conectati (5 minute) function pmconectati($text,$uid){ $timeout = 300; $timeon = time()-$timeout; $sql = @mysql_query("SELECT id FROM dragosh_users WHERE lastact>'".$timeon."'"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO dragosh_private SET byuid = '".$uid."', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'"); } } //////////////////////////// NOTIFICARE CATRE TOTI USERII function notcatretotiuserii($text){ $sql = @mysql_query("SELECT id FROM dragosh_users"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO dragosh_notificare SET touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'"); } } ////////////////////////////////////////////amant by dragosh function amant($who) { $dragosh = mysql_fetch_array(mysql_query("SELECT tu FROM dragosh_amant WHERE eu='".$who."'")); return $dragosh[0]; } ////////////////////////////adaugi asta in core.php oriunde :D ///////////////////////////////////////////////predefinite function iapredefinite($text) { $sql = "SELECT * FROM n3s_predefinite"; $predefinite = mysql_query($sql); while($predefinit=mysql_fetch_array($predefinite)) { $cod = $predefinit[1]; $xtext = $predefinit[2]; $text = str_replace($cod,"$xtext",$text); } return $text; } /////////////// ############################# Baiatul zilei ################ function baiatul_zilei(){ $select = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM eminem_baiatul_castig WHERE data='".date("d/m/y")."'")); if(date("G")>23&&date("G")<2&&$select[0]==0){ $sql = mysql_query("SELECT DISTINCT vot FROM eminem_baiatulzilei"); while($item = mysql_fetch_array($sql)){ $cate = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM eminem_baiatulzilei WHERE vot='".$item[0]."'")); mysql_query("UPDATE eminem_baiatulzilei SET ok='".$cate[0]."' WHERE vot='".$item[0]."'"); } $sql = mysql_query("SELECT DISTINCT vot, cine FROM eminem_baiatulzilei ORDER BY vot DESC LIMIT 0,1"); if(mysql_num_rows($sql)>0){ while($item = mysql_fetch_array($sql)){ $cate = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM eminem_baiatulzilei WHERE vot='".$item[0]."'")); $k = mysql_query("INSERT INTO eminem_baiatul_castig VALUES('','".$item[1]."','".$cate[0]."','".date("d/m/y")."')"); } if($k)mysql_query("TRUNCATE TABLE eminem_baiatulzilei"); } } } ######################################################### //////////////////////////////////////////// /////////////////////////////////////////////Mesaj Live echipa function liveechipa($sid){ $shbox = ""; $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM dragosh_shouts2 ORDER BY shtime DESC LIMIT 1")); $shnick = getnick_uid($lshout[1]); $shbox .= "".getsimbol($lshout[1])."".$shnick.": "; $shbox .= parsepm($lshout[0],$sid); $shbox .= "
"; //if (isowner1(getuid_sid($sid))){ if(ismod(getuid_sid($sid))) { if(isdforums(getuid_sid($sid))) { $shbox .= "\"vezi\"/ "; $shbox .= "\"scrie\"/ "; $shbox .= "\"sterge\"/"; } } $shbox .= "
"; $shbox .= "
"; if ($lshout[0]==".x.") { $livegol = ""; return $livegol; }else{ return $shbox; } } /////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// //////////////////////////////////////////////////// ////////////////////////////////////////// function candelmd($uid,$bid) { $minfo = mysql_fetch_array(mysql_query("SELECT bowner FROM lirmeditatii WHERE id='".$bid."'")); if(ismod($uid)) { return true; } if($minfo[0]==$uid) { return true; } return false; } /////////////////////////////////////////////////////////////////////////////// /////////////// in core.php function urmconectati($uid) { $counter =0; $urmarit = mysql_query("SELECT name, target FROM lib3rtymrc_urmariti WHERE name='".$uid."'"); while($urmarit2=mysql_fetch_array($urmarit)) { if($urmarit2[0]==$uid) { $target = $urmarit2[1]; }else{ $target = $urmarit2[0]; } if(isonline($target)) { $counter++; } } return $counter; } /////////////////////////////////////////////////////////////////////////////// ////////////////////////// function candelpoezie($uid,$bid) { $minfo = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_poezii WHERE id='".$bid."'")); if(ismod($uid)) { return true; } if($minfo[0]==$uid) { return true; } return false; } function candelpoezii($uid,$bid) { $minfo = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_poezii WHERE id='".$bid."'")); if(ismod($uid)) { return true; } if($minfo[0]==$uid) { return true; } return false; } ////////////////////////////////\ function candelcantare($uid,$bid) { $minfo = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_cantari WHERE id='".$bid."'")); if(ismod($uid)) { return true; } if($minfo[0]==$uid) { return true; } return false; } ///////////////////////////operatori function operatori($ip) { $result = test("SELECT * FROM lib3rtymrc_operatori ORDER BY ip, subip","n"); while($ranges = mysql_fetch_array($result)) { if(ipstatut($ip, $ranges[1], $ranges[2])) { return $ranges["name"]; } } } /// quizz live by gabykent /// //////////////////////////////////////////// function getshoutboxquizz($sid){ $shbox .= "Quizz Live
*******
***"; $shbox .= "$numesite"; $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM gabykent_boss_quizz ORDER BY shtime DESC LIMIT 1")); $shnick = getnick_uid($lshout[1]); //$shbox .= "".getsimbol($lshout[1])."".$shnick.": "; $shbox .= parsepm($lshout[0],$sid); $shbox .= "***
*******
"; $shbox .= "Raspunde: "; $shbox .= "
"; if(mliveon()) { if(ismod(getuid_sid($sid))) { $shbox .= "arhiva "; if(ismod(getuid_sid($sid))) $shbox .= "scrie"; } }else{ $shbox .= "arhiva "; if(ismod(getuid_sid($sid))) $shbox .= "|scrie"; } //if (isowner1(getuid_sid($sid))){ if(ismod(getuid_sid($sid))) { if(isdforums(getuid_sid($sid))) { $shbox .= "|sterge"; } } return $shbox; } ///////////////////////////////////////////// /// quizz live by gabykent /// ////////////////////////////////// ///////////////////////////////////////get extension icon function getextimg1($ext) { $ext = strtolower($ext); switch ($ext) { case "jpg": case "gif": case "png": case "bmp": return "\"*\"/"; break; case "zip": case "rar": return "\"*\"/"; break; case "jad": case "jar": return "\"*\"/"; break; case "amr": case "wav": case "mp3": return "\"*\"/"; break; case "mpg": case "3gp": case "mp4": return "\"*\"/"; break; default: return "\"*\"/"; break; } } ///////////////////////////////////////// ////////////////////////////////in core function xplogo($fus) { $xp = time() + ($fus * 60 * 60); $ora =date("G", $xp); if ($ora <= 4) { $logo="\"x\"/" ; }else if ($ora <= 10) { $logo="\"x\"/" ; }else if ($ora <= 16) { $logo="\"x\"/" ; }else if ($ora <= 22) { $logo="\"x\"/" ; } return $logo; } function icon($sid) { $shad0w = "\"*\"/"; return $shad0w; } /////////////////// //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

pacman, rainbows, and roller s