The Soda Pop
$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) { $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 = "
"; $rform .= "$ue (*)Numele:
"; $rform .= "$pe (*)Parola:
"; $rform .= "$ce (*)Repeta parola:
"; $rform .= "$ad (*)Locatia:
"; $rform .= "$me (*)E-mail:
"; $rform .= "MoTTo:
"; $rform .= "(*)Data nasterii
Ziua:"; $rform .= ""; $rform .= "
"; $rform .= "Luna:"; $rform .= "
"; $rform .= "Anul:
"; $rform .= "Sex:"; $rform .= "
"; $rform .= "$codr Cod Recuperare:
"; $rform .= "
"; $rform .= ""; $rform .= "
$errl"; return $rform; } //////////////////////////////////////////// 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 bana pe ip useri function poatequiz($uid) { $valida4 = mysql_fetch_array(mysql_query("SELECT perm, quiz FROM lib3rtymrc_users WHERE id='".$uid."' AND quiz='1'")); if(($valida4[1]=='1')&&($valida4[0]>'0')) { return true; }else{ return false; } } ////////////////////////poate sterge poze album 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; } //////////////////blocat la inregistrare function ipblocat($str) { $str = str_replace(" ","",$str); $str = strtolower($str); $res = mysql_query("SELECT ip FROM xmaxro_ipblocat"); while ($row = mysql_fetch_array($res)) { $sites[] = $row[0]; } for($i=0;$i0) { return false; } } return true; } //////////////////////////mail valid function checkemail($email) { $regexp = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"; if (eregi($regexp, $email)) { return true; } else { return false; } } ///////////////////////////poate pune poze la album function pozealbum($uid) { $valida8 = mysql_fetch_array(mysql_query("SELECT perm, album FROM xmaxro_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; } ////////////////////////////pm la toti userii function pmcatretotiuserii($text){ $sql = @mysql_query("SELECT id FROM lib3rtymrc_users"); while ($id = @mysql_fetch_array($sql)){ @mysql_query("INSERT INTO lib3rtymrc_private SET byuid = '0', touid = '".$id[0]."', text = '".$text."', timesent = '".time()."'"); } } ////////////////////////////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, perm, 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, perm, 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 = 360; $timenw = time(); $timeout = $timenw - $timeto; $exec = mysql_query("DELETE FROM lib3rtymrc_chonline WHERE lton<'".$timeout."'"); $timeto = 2*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 funwap.ro 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'"); } } ///////////////////////////////////////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 = 350; $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 perm FROM lib3rtymrc_users WHERE id='".$uid."'")); if($perm[0]>0) { 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) { 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]; } /////////////////////////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, $uid) { $pm = mysql_fetch_array(mysql_query("SELECT popmsg FROM lib3rtymrc_users WHERE id='".$who."'")); if($pm[0]=='2') { if (ismod($uid)) { return true; }else{ return false; } return false; }else if($pm[0]=='1') { if (arebuds($uid, $who)||ismod($uid)) { return true; }else{ return false; } }else if($pm[0]=='0') { return true; } } //////////////////////////////////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 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 .= "".getsimbol($lshout[1])."".$shnick.": "; $shbox .= parsepm($lshout[0],$sid); $shbox .= "
"; if(mliveon()) { if(ismod(getuid_sid($sid))) { $shbox .= "[+] "; $shbox .= "[scrie]"; } }else{ $shbox .= "[+] "; $shbox .= "[scrie]"; } //if (isowner1(getuid_sid($sid))){ if(ismod(getuid_sid($sid))) { if(isdforums(getuid_sid($sid))) { $shbox .= ", [x]"; } } $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 .= "
"; $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
"; $popmsg = mysql_fetch_array(mysql_query("SELECT popmsg FROM lib3rtymrc_users WHERE id='".$uid."'")); $popmsgbox .= "
"; $popmsgbox .= "
"; $popmsgbox .= "

"; $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 = getdragoste($text); $text = getsarbatori($text); $text = getsexy($text); $text = gethot($text); $text = getsmldiverse($text); $text = getsmlfun($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); $text = getdragoste($text); $text = getsarbatori($text); $text = getsexy($text); $text = gethot($text); $text = getsmldiverse($text); $text = getsmlfun($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 = getdragoste($text); $text = getsarbatori($text); $text = getsexy($text); $text = gethot($text); $text = getsmldiverse($text); $text = getsmlfun($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 = getdragoste($text); $text = getsarbatori($text); $text = getsexy($text); $text = gethot($text); $text = getsmldiverse($text); $text = getsmlfun($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 FORUM function addtoforum($uid) { $timeto = 150; $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."'"); } } /////////////////////////////////////////////////////////CONECTATI TRIVIA function addtotrivia($uid) { $timeto = 150; $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."'")); if($sesx[0]>0) { if(!isuser(getuid_sid($sid))) { return false; } //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); } ////////////////////////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(); $timeout = $tm - 24000; //time out = 400 minutes $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."'"); $res = mysql_query("INSERT INTO lib3rtymrc_online SET userid='".$uid."', actvtime='".$tm."', 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."', 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]; } //////////////////////////////////////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; } //////////////////blocat la inregistrare function inregistrare($str) { $str = str_replace(" ","",$str); $str = strtolower($str); $res = mysql_query("SELECT browser FROM xmaxro_inregistrare"); while ($row = mysql_fetch_array($res)) { $sites[] = $row[0]; } for($i=0;$i0) { return false; } } return true; } ///////////////////////////////////////////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; } /* /////////////////////////////////////////////////////////////////////// // WAPNEW.INFO bY I0nwTZz // /////////////////////////////////////////////////////////////////////// */ ///////////////////////////////////////////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) { $days=0; $mins=0; $hours=0; if ($sec>59) { $secs=$sec%60; $mins=$sec/60; $mins=(integer)$mins; } if ($mins>60) { $hours=$mins/60; $hours=(integer)$hours; $mins=$mins%60; } if ($hours>24) { $days=$hours/24; $days=(integer)$days; $hours=$hours%24; } if($days>0) { return "$days zile, $hours ore, $mins minute, $secs secunde"; } if($days<1) { if($hours>0) { return "$hours ore, $mins minute, $secs secunde"; } if($hours<1) { return "$mins minute, $secs secunde"; } } } ///////////////////////////////////////// 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 "\".\"/\".\"/\".\"/\".\"/\".\"/"; } } ///////////////////////////////////////// functie function functie($uid) { $functie = mysql_fetch_array(mysql_query("SELECT functie FROM lib3rtymrc_users WHERE id='".$uid."'")); return $functie[0]; } /////////////////////////////////////////Statutu function getstatus($uid) { $info= mysql_fetch_array(mysql_query("SELECT perm, plusses FROM lib3rtymrc_users WHERE id='".$uid."'")); if(isbanned($uid)) { return "Banat(a)!"; } if($info[0]=='4') { return "Proprietar"; }else{ if($info[1]<10) { return "NOU!"; }else if($info[1]<50) { return "BOBOCEL"; }else if($info[1]<125) { return "STIMABIL"; }else if($info[1]<500) { return "RESPECTAT"; }else if($info[1]<4000) { return "Veteran"; }else if($info[1]<6000) { return "Pensionar"; }else if($info[1]<10000) { return "LORD"; }else { return "av3ntura V.I.P"; } } } /////////////////////////////////////////Simboluri function getsimbol($uid) { $info= mysql_fetch_array(mysql_query("SELECT perm, plusses FROM lib3rtymrc_users WHERE id='".$uid."'")); if(isbanned($uid)) { return "(x)"; } if($info[0]=='4') { return "©"; }else if($info[0]=='3') { return "¹"; }else if($info[0]=='2') { return "²"; }else if($info[0]=='1') { 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 = "Dute la pagina
"; $rets .= ""; $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; } ///////////////////////////////////////////////Get the smilies dragoste function getdragoste($text) { $sql = "SELECT * FROM lib3rtymrc_dragoste"; $dragoste = mysql_query($sql); while($smilie=mysql_fetch_array($dragoste)) { $scode = $smilie[1]; $spath = $smilie[2]; $text = str_replace($scode,"\"$scode\"/",$text); } return $text; } ///////////////////////////////////////////////Get the smilies sarbatori function getsarbatori($text) { $sql = "SELECT * FROM lib3rtymrc_sarbatori"; $sarbatori = mysql_query($sql); while($smilie=mysql_fetch_array($sarbatori)) { $scode = $smilie[1]; $spath = $smilie[2]; $text = str_replace($scode,"\"$scode\"/",$text); } return $text; } ///////////////////////////////////////////////Get the smilies sexy function getsexy($text) { $sql = "SELECT * FROM lib3rtymrc_sexy"; $sexy = mysql_query($sql); while($smilie=mysql_fetch_array($sexy)) { $scode = $smilie[1]; $spath = $smilie[2]; $text = str_replace($scode,"\"$scode\"/",$text); } return $text; } ///////////////////////////////////////////////Get the smilies hot function gethot($text) { $sql = "SELECT * FROM lib3rtymrc_hot"; $hot = mysql_query($sql); while($smilie=mysql_fetch_array($hot)) { $scode = $smilie[1]; $spath = $smilie[2]; $text = str_replace($scode,"\"$scode\"/",$text); } return $text; } ///////////////////////////////////////////////Get the smilies diverse function getsmldiverse($text) { $sql = "SELECT * FROM lib3rtymrc_smldiverse"; $smldiverse = mysql_query($sql); while($smilie=mysql_fetch_array($smldiverse)) { $scode = $smilie[1]; $spath = $smilie[2]; $text = str_replace($scode,"\"$scode\"/",$text); } return $text; } ///////////////////////////////////////////////Get the smilies fun function getsmlfun($text) { $sql = "SELECT * FROM lib3rtymrc_smlfun"; $smlfun = mysql_query($sql); while($smilie=mysql_fetch_array($smlfun)) { $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_private SET text='".$msg."', byuid='0', touid='".$who."', unread='1', timesent='".time()."'"); } /////////////////////// auto pm function pmautomat($msg, $who) { mysql_query("INSERT INTO lib3rtymrc_private 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 funwap.ro iti ureaza bun venit si o zi superba,ne bucuram ca ai ales clubul nostru si speram sa te simti cat mai bine aici, daca ai orice problema legata de site nu ezita sa ceri asistenta unui membru al echipei si nu uita sa zici tuturor de FunWap!-dance-[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; } } } /////////////////////// GET lib3rtymrc_users user id from nickname function getuid_nick($nick) { $uid = mysql_fetch_array(mysql_query("SELECT id FROM lib3rtymrc_users WHERE name='".$nick."'")); return $uid[0]; } /////////////////////////////////////////Is owner? function isowner1($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='4') { return TRUE; }else{ return FALSE; } } /////////////////////////////////////////Is admin sef? function isowner($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='3') { return TRUE; }else{ return FALSE; } } /////////////////////////////////////////Is admin? function isadmin($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='2') { return true; }else{ return false; } } /////////////////////////////////////////Is moderator? function ismoderator($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm FROM lib3rtymrc_users WHERE id='".$uid."'")); if($admn[0]=='1') { return true; }else{ return false; } } /////////////////////////////////////////baneaza function isban($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm, ban FROM lib3rtymrc_users WHERE id='".$uid."'")); if(($admn[1]=='1')&&($admn[0]>'0')) { return true; }else{ return false; } } /////////////////////////////////////////baneaza ip function isbanip($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm, banip FROM lib3rtymrc_users WHERE id='".$uid."'")); if(($admn[1]=='1')&&($admn[0]>'0')) { return true; }else{ return false; } } /////////////////////////////////////////baneaza chat forum function isbanchatforum($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm, banchatforum FROM lib3rtymrc_users WHERE id='".$uid."'")); if(($admn[1]=='1')&&($admn[0]>'0')) { return true; }else{ return false; } } /////////////////////////////////////////arunca function isarunca($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm, arunca FROM lib3rtymrc_users WHERE id='".$uid."'")); if(($admn[1]=='1')&&($admn[0]>'0')) { return true; }else{ return false; } } ////////////////////////////////////////valideaza function isvalideaza($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm, validari FROM lib3rtymrc_users WHERE id='".$uid."'")); if(($admn[1]=='1')&&($admn[0]>'0')) { return true; }else{ return false; } } ////////////////////////////////////////debaneaza function isdebaneaza($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm, debaneaza FROM lib3rtymrc_users WHERE id='".$uid."'")); if(($admn[1]=='1')&&($admn[0]>'0')) { return true; }else{ return false; } } ////////////////////////////////////////vizualiazeaza actiuni si rapoparte function isactiunir($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm, actiunir FROM lib3rtymrc_users WHERE id='".$uid."'")); if(($admn[1]=='1')&&($admn[0]>'0')) { return true; }else{ return false; } } ////////////////////////////////////////sterge forum si mes live function isdforums($uid) { $admn = mysql_fetch_array(mysql_query("SELECT perm, dforum FROM lib3rtymrc_users WHERE id='".$uid."'")); if(($admn[1]=='1')&&($admn[0]>'0')) { return true; }else{ return false; } } ///////////////////////////////////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("/\[site\=(.*?)\](.*?)\[\/site\]/is","$2",$text); $text = preg_replace("/\[poza\=(.*?)\](.*?)\[\/poza\]/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 = 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("nyky","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("/\[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 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
"; } } //////////////////////////////////////////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; } ?>