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