";
}
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;
}
function trimitepm($uid, $who)
{
$mod = mysql_fetch_array(mysql_query("SELECT modpm FROM lib3rtymrc_users WHERE id='".$who."'"));
$mod = $mod[0];
if (ismod($uid))
{
return true;
}
if ($mod==0)
{
return true;
}
if ($mod==1)
{
return false;
}
if ($mod==2)
{
if(arebuds($uid, $who))
{
return true;
}
return false;
}
if ($mod==3)
{
if(arebuds($uid, $who))
{
return false;
}
return true;
}
if ($mod>3)
{
return true;
}
return false;
}
function valid($uid)
{
$shad = mysql_fetch_array(mysql_query("SELECT validated FROM lib3rtymrc_users WHERE id='".$uid."'"));
if($shad[0]>0)
{
return true;
}else{
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 perm='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 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;
}
}
function nou($sid)
{
$uid = getuid_sid($sid);
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_private WHERE unread='1' AND touid='".$uid."'"));
if ($unreadinbox[0]=="1")
{
$pm = "(!) Ai un mesaj nou! ";
}
if ($unreadinbox[0]=="2")
{
$pm = "(!) Ai doua mesaje noi! ";
}
if ($unreadinbox[0]>2)
{
$pm = "(!) Ai $unreadinbox[0] mesaje noi! ";
}
$unreadnot=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_notificare WHERE unread='1' AND touid='".$uid."'"));
if ($unreadnot[0]=="1")
{
$not = "(!) Ai o notificare noua! ";
}
if ($unreadnot[0]>1)
{
$not = "(!) Notificari noi: $unreadnot[0] ";
}
$toate = "$pm$not";
return $toate;
}
//////////////////////Function add user to online list :P
function addonline($uid,$place,$plclink)
{
/////delete inactive users
$tm = time();
$timeout = $tm - 7200; //time out = 120 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."'");
$bud = mysql_query("UPDATE lib3rtymrc_buddies SET lastact='".time()."' WHERE uid='".$uid."' OR tid='".$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($mins!=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($mins!=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($mins!=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($mins!=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($mins!=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 perm, 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 perm, 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 = "pagina";
$rets .= "[du-te]";
$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,"",$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, 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 noi![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];
}
function isowner1($uid)
{
$admn = mysql_fetch_array(mysql_query("SELECT perm, 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 perm, 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 perm, 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 perm, 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 perm, 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("/\[forum\=(.*?)\](.*?)\[\/forum\]/is","$2",$text);
$text = preg_replace("/\[fcat\=(.*?)\](.*?)\[\/fcat\]/is","$2",$text);
$text = preg_replace("/\[user\=(.*?)\](.*?)\[\/user\]/is","$2",$text);
$text = preg_replace("/\[pet](.*?)\[\/pet\]/is","Hraneste-mi Animalutzul",$text);
$text = preg_replace("/\[pet\=(.*?)\](.*?)\[\/pet\]/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","",$text);
$text = preg_replace("/\[gal\=(.*?)\](.*?)\[\/gal\]/is","$2",$text);
$text = str_replace('Avioanele', "Avioanele", $text);
// download
$text = preg_replace("/\[download\=(.*?)\](.*?)\[\/download\]/is","$2",$text);
$text = preg_replace("/\[dcat\=(.*?)\](.*?)\[\/dcat\]/is","$2",$text);
// dedicatie
$text = preg_replace("/\[dedicatie\=(.*?)\](.*?)\[\/dedicatie\]/is","$2",$text);
$text = preg_replace("/\[mss\=(.*?)\](.*?)\[\/mss\]/is","",$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/]")<=10){
$text = str_replace("[br/]"," ",$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("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("/\[url\=(.*?)\](.*?)\[\/url\]/is","$2",$text);
$text = preg_replace("/\[poza\=(.*?)\](.*?)\[\/poza\]/is","",$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 perm, 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 MagiculTriviei";
}
}
function fata_zilei(){
$select = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM xp_fatazilei_win WHERE data='".date("d/m/y")."'"));
$now1 = time();
$start1 = date("Y-m-d")." 23:00:00";
$end1 = date("Y-m-d")." 24:00:00";
$tstamp11 = strtotime($start1);
$tstamp22 = strtotime($end1);
if($now1>$tstamp11 && $now1<$tstamp22) {
$sql = mysql_query("SELECT DISTINCT vot FROM xp_fatazilei");
while($item = mysql_fetch_array($sql)){
$cate = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM xp_fatazilei WHERE vot='".$item[0]."'"));
mysql_query("UPDATE xp_fatazilei SET ok='".$cate[0]."' WHERE vot='".$item[0]."'");
}
/////
$sql = mysql_query("SELECT DISTINCT vot, cine FROM xp_fatazilei 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 xp_fatazilei WHERE vot='".$item[0]."'"));
$k = mysql_query("INSERT INTO xp_fatazilei_win VALUES('','".$item[1]."','".$cate[0]."','".date("d/m/y")."')");
}
if($k)mysql_query("TRUNCATE TABLE xp_fatazilei");
}
}
}