View file moduls/func.php

File size: 24.5Kb
<?php
function carthex( $string )
{
$string = str_replace ( ">window.location<" , "am a bloody fool" , $string );
$string = str_replace ( "meta HTTP-EQIV" , "am a bloody fool" , $string );
$string = str_replace ( "http://bit.ly" , "am a bloody fool" , $string );
$string = str_replace ( "08104912655" , "am a bloody fool" , $string );
$string = str_replace ( "*tk" , "***" , $string );
$string = str_replace ( "runznet*" , "*" , $string );
return $string ;
}
if (isset($_COOKIE["username"]) && isset($_COOKIE["password"]) && !isset($_SESSION["user"]))
{
$cuser = $_COOKIE["username"];
$cpass = $_COOKIE["password"];
$check = mysql_num_rows(mysql_query("SELECT `username` FROM `b_users` WHERE `username` = '$cuser' AND `password` = '$cuser' AND `password` = '$cpass'"));
if ($check > 0)
{
$_SESSION["user"] = $cuser;
} else {
setcookie("username", "", time()-86400);
setcookie("password", "", time()-86400);
}

}

function updateguest()
{
$guestip=$_SERVER['REMOTE_ADDR'];
$guestbrowser=$_SERVER['HTTP_USER_AGENT'];
$query = mysql_query("SELECT * FROM b_guestsonline WHERE guestip='$guestip' AND browser='$guestbrowser'");
if(mysql_num_rows($query) > 0)
{
$time = time();

mysql_query("INSERT INTO b_guestsonline set time='$time', guestip='$guestip',browser='$guestbrowser'");
}
}

function timeago($time){
$time_difference = time() - $time;
$seconds = $time_difference ;
$minutes = round($time_difference / 60);
$hours = round($time_difference / 3600);
$days = round($time_difference / 86400);
$weeks = round($time_difference / 604800);
$months = round($time_difference / 2419200);
$years = round($time_difference / 29030400);

if($seconds <= 60)
{
Return "$seconds seconds ago";
}
elseif($minutes <= 60)
{
if($minutes==1)
{ Return"one minute ago"; }
else
{ Return"$minutes minutes ago"; }
}
elseif($hours <= 24)
{
if($hours==1)
{ Return"one hour ago"; }
else
{ Return"$hours hours ago"; }
}
elseif($days <=7)
{
if($days==1)
{ Return"one day ago"; }
else
{ Return"$days days ago"; }
}
elseif($weeks <=4)
{
if($weeks==1)
{ Return"one week ago"; }
else
{ Return"$weeks weeks ago"; }
}
elseif($months <=12)
{
if($months==1)
{ Return"one month ago"; }
else
{ Return"$months months ago"; }
}
else
{
if($years==1)
{ Return"one year ago"; }
else
{ Return"$years years ago"; }
}
}

function getrating($posts)
{
if($posts<=5)
{
return "<font color='red'><b>Novice</b></font> <img src='../rating/0.0.gif' alt='0 star'/>";
}
elseif($posts<=20)
{
return "<font color='darkviolet'><b>Amateur</b></font> <img src='../rating/1.0.gif' alt='1 star'/>";
}
elseif($posts<=40)
{
return "<font color='purple'><b>Senior</b></font> <img src='../rating/1.5.gif' alt='2 star'/>";
}
elseif($posts<=100)
{
return "<font color='greenyellow'><b>Enthusiast</b></font> <img src='../rating/2.0.gif' alt='3 star'/>";
}
elseif($posts<=170)
{
return "<font color='lime'><b>Professional</b></font> <img src='../rating/2.5.gif' alt='4 star'/>";
}
elseif($posts<=300)
{
return "<font color='dodgerblue'><b>Expert</b></font> <img src='../rating/3.0.gif' alt='5 star'/>";
}
elseif($posts<=400)
{
return "<font color='deepskyblue'><b>Leader</b></font> <img src='../rating/3.5.gif' alt='1 star'/>";
}
elseif($posts<=480)
{
return "<font color='gold'><b>Veteran</b></font> <img src='../rating/4.0.gif' alt='1 star'/>";
}
elseif($posts<=520)
{
return "<font color='yellow'><b>Master</b></font> <img src='../rating/4.5.gif' alt='1 star'/>";
}
elseif($posts>700)
{
return "<font color='black'><b>U</b></font><font color='green'><b>l</b></font><font color='red'><b>t</b></font><font color='lime'><b>i</b></font><font color='blue'><b>m</b></font><font color='yellow'><b>a</b></font><font color='pink'><b>t</b></font><font color='brown'><b>e</b></font> <img src='../rating/4.5.gif' alt='1 star'/>";
}
}

function getworth($user)
{
$perchat = 5; //Worth of each chat post
$pertopic = 10; //Worth of each topic created
$perrep = 5; //worth of each reply
$name = 'JL'; //Name of currency. Can be empty
$symbol = '#'; // symbol of currency leave empty for nothing.

$chat = mysql_num_rows(mysql_query("SELECT * FROM b_chat WHERE chatter='$user'")); //Number of chat user made
$tchat = $chat * $perchat; //The actual worth of chat

$reply = mysql_num_rows(mysql_query("SELECT * FROM b_replies WHERE poster='$user'")); //reply to forum

$treply = $reply = mysql_num_rows(mysql_query("SELECT * FROM b_tutorialreplies WHERE poster='$user'")); //reply to tutorials
$replysum = $reply + $treply; //sum them up

$actrep = $replysum * $perrep; //actual worth of replies

$topic = mysql_num_rows(mysql_query("SELECT * FROM b_topics WHERE poster='$user'")); // Number of topics made

$ttopic = mysql_num_rows(mysql_query("SELECT * FROM b_tutorialtopics WHERE poster='$user'")); // Number of tutorial topics made

$acttop = $topic * $pertopic; //Worth of forum topics

$total = $tchat + $actrep + $acttop; // The total money worth

$returnee = $symbol.$total.' '.$name;
return $returnee;
}


function isloggedin()
{
if(isset($_SESSION["user"]))
{
return true;
}
else
if(isset($_COOKIE["user"]))
{
$_SESSION["user"] = $_COOKIE["user"];
return true;
}
else
{
return false;
}
}

function cleanvalues($string)
{
$string=trim($string);
return $string;
}
$user=$_SESSION["user"];
function user_info($user, $field)
{
//echo"$user and $field success";
$query=mysql_query("SELECT $field FROM b_users WHERE username='$user'");
$info=mysql_fetch_array($query);
$info=$info[$field];
return $info;
}

function user_info2($uid, $field)
{
//echo"$user and $field success";
$query2=mysql_query("SELECT $field FROM b_users WHERE userID=$uid") or mysql_error();
//echo"$field<br/>";
$info=@mysql_fetch_array($query2);
//print_r($info);
$info=$info[$field];
return $info;
}

function getrank($num)
{
if($num==0)
{
return "Member";
}
elseif($num==1)
{
return "Content Creator";
}
elseif($num==2)
{
return "Head Admin";
}
elseif($num==0)
{
return "Member";
}
}

function geticon($num)
{
if($num==0)
{
return "http://blueloaded.tk/avatars/wl.png";
}
elseif($num==1)
{
return "http://blueloaded.tk/avatars/admin2.gif";
}
elseif($num==2)
{
return "http://blueloaded.tk/avatars/admin1.png";
}
elseif($num==7)
{
return "http://blueloaded.tk/avatars/admin7.GIF";
}
elseif($num==6)
{
return "http://blueloaded.tk/avatars/admin3.gif";
}
elseif($num==5)
{
return "File Sharer";
}
elseif($num==4)
{
return "http://blueloaded.tk/avatars/admin2.gif";
}
elseif($num==3)
{
return "Co-ordinator";
}
elseif($num==0)
{
return "Member";
}
}

function get_rows($table_and_query)
{
$total=mysql_query("SELECT COUNT(*) FROM $table_and_query");
$total=mysql_fetch_array($total);
return $total[0];
}

function get_row($query)
{ $total=mysql_num_rows(mysql_query($query));
return $total;
}

function cleanvalues2($string)
{
$string=strip_tags($string);
//$string=preg_replace("/[!#$%^&*<>+=]/", ' ', $string);
//$string=str_replace('"', ' ', $string);
$string=htmlentities($string, ENT_QUOTES);
return $string;
}

function bbcode($string){
$string = preg_replace("(\[b\](.+?)\[\/b])is",'<b>$1</b>',$string);
$string = preg_replace("(\[code\](.+?)\[\/code])is",'<textarea>$1</textarea>',$string);
$string = preg_replace("(\[php\](.+?)\[\/php])is",'<br>$1<span style="border-top: 2px dotted"><b>COPY CODE</b><br><textarea cols="18" rows="2">$1</textarea></div>',$string);
$string = preg_replace("(\[center\](.+?)\[\/center])is",'<center>$1</center>',$string);
$string = preg_replace("(\[i\](.+?)\[\/i])is",'<i>$1</i>',$string);
$string = preg_replace("(\[u\](.+?)\[\/u])is",'<u>$1</u>',$string);
$string = preg_replace("(\[s\](.+?)\[\/s])is",'<strike>$1</strike>',$string);
$urlstring = " a-zA-Z0-9\:\&\/\-\?\.\=\_\~\#\'\%";
$string = preg_replace("(\[url\]([$urlstring]*)\[/url\])", '<a href="$1" target="_blank">$1</a>', $string);
$string = preg_replace("(\[url\=([$urlstring]*)\]([$urlstring]*)\[/url\])", '<a href="$1" target="_blank">$2</a>', $string);
$string = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<font color='$1'>$2</font>",$string);
$string = preg_replace("(\[font=(.+?)\](.+?)\[\/font\])is","<font face='$1'>$2</font>",$string);
$string = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<font size='$1'>$2</font>",$string);
$string = preg_replace("(\[quote\](.+?)\[\/quote])is","\"<font color=red>$1</font>\"<br/>",$string);
$string = preg_replace("/\[img\](.+?)\[\/img\]/", '<img src="$1">', $string);
$string = preg_replace("/\[img=(.+?)\]\[\/img\]/", '<img src="$1">', $string);

//SPAM WORD
$string = str_replace("runznet*","Spam Word Blocked Lol",$string);

$string = str_replace("http://www.elitenflcheap.com/","Spam Word Blocked Lol",$string);

$string = str_replace(".wapka.mobi/","Spam Word Blocked Lol",$string);

$string = str_replace("w- w- w","Spam Word Blocked Lol",$string);

$string = str_replace("w ,w, w.","Spam Word Blocked Lol",$string);

$string = str_replace(".t- k","Spam Word Blocked Lol",$string);

$string = str_replace("w. w. w.","Spam Word Blocked Lol",$string);

$string = str_replace("w, w, w,","Spam Word Blocked Lol",$string);

$string = str_replace("naiju","***",$string);

$string = str_replace("gurushero","***",$string);

$string = str_replace("trustloaded","***",$string);

$string = str_replace("Cheap Jerseys","Spam Word Blocked Lol",$string);

$string = str_replace("RUNZNET","Spam Word Blocked Lol",$string);


$string = str_replace("nike nfl jerseys","Spam Word Blocked Lol",$string);


$string = str_replace("t*k","Spam Word Blocked Lol",$string);


$string = str_replace("T K","Spam Word Blocked Lol",$string);
$string = str_replace("WWW.AGUNSLOADED.ML","Spam Word Blocked Lol",$string);

$string = str_replace("[img]http://www.tiny.cc/fy0n2w[/img]","Spam Word Blocked Lol",$string);

$string = str_replace("toocoded","Spam Word Blocked Lol",$string);

$string = str_replace("http://www.nikenfljerseysofficialwholesale.com/","Spam Word Blocked Lol",$string);

$string = str_replace("www.agunsloaded.ml","Spam Word Blocked Lol",$string);
$string = str_replace("Cheap Oakleys","Spam Word Blocked Lol",$string);
$string = str_replace("http://www.nfljerseysnikeauthorize.com/","Spam Word Blocked Lol",$string);

$string = str_replace("New NFL Jerseys","Spam Word Blocked Lol",$string);

$string = str_replace("http://www.officialcheapjerseys.com/","Spam Word Blocked Lol",$string);

$string = str_replace("officialcheapjerseys","Spam Word Blocked Lol",$string);

$string = str_replace("MOBLOADERS","Spam Word Blocked Lol",$string);

$string = str_replace("naijaloAd3d.com","Spam Word Blocked Lol",$string);

$string = str_replace("www,di!r3ctch3atz,tk","SPAM IS BLOCK BY GURUSBEST",$string);

$string = str_replace("www.9.jacaf3.com","***",$string);

$string = str_replace("9jacaf33.com","***",$string);


$string = str_replace("Pladj stjp doijg copeda mja paste f4m www,directcheatz,tk","***",$string);

$string = str_replace("WAPKA","***",$string);

$string = str_replace("gurusonpoint","***",$string);

$string = str_replace("gurusbase","***",$string);

$string = str_replace("gurusbase.net","***",$string);

$string = str_replace("mobilecrew","***",$string);

$string = str_replace(".flickajgar","***",$string);

$string = str_replace("w!apka","***",$string);

$string = str_replace("flickr","***",$string);

$string = str_replace("MOBIL3CR3W","***",$string);

$string = str_replace("proudlyboy","***",$string);
$string = str_replace(">window.location<","***",$string);

$string = str_replace("META","***",$string);

$string = str_replace("mobload3r",
"***",$string);

$string = str_replace("mobload3r.tk","***",$string);
$string = str_replace("hacklord","Da Great Boss",$string);
$string = str_replace(".Tk","***",$string);

$string = str_replace(".T_K","***",$string);

$string = str_replace(".TK","***",$string);

$string = str_replace(".t-_K","***",$string);

$string = str_replace("w.w.w.naijafr33.com","***",$string);

$string = str_replace("naijafr33","***",$string);

$string = str_replace("naijafre3.c0m","***",$string);

$string = str_replace("hack","h*ck",$string);

$string = str_replace("keygen","k*ygen",$string);

$string = str_replace("sex","s*x",$string);

$string = str_replace("fuck","f**k",$string);

$string = str_replace(".In","S***",$string);

$string = str_replace("incomepart.com","",$string);

$string = str_replace("","",$string);

$string = str_replace("wApka_m0bi","***",$string);

$string = str_replace("EXAMWIZARDS.NET","***",$string);

$string = str_replace("t_jgc","***",$string);

$string = str_replace("smiggl3","***",$string);

$string = str_replace(".3u","***",$string);

$string = str_replace("_m0bi","***",$string);
$string = str_replace("_pjar0","SPAM IS BLOCK BY GURUSBEST",$string);
$string = str_replace("Hacklord","Dagreat Boss",$string);

$string = str_replace("TooCoded","***",$string);

//BLOCK WORD
$string = str_replace("SELECT","sel ect",$string);
$string = str_replace("mysql_fetch_array","mysql_fetch _array",$string);
$string = str_replace("mysql_query","mysql._query",$string);
$string = str_replace("DROP","d rop",$string);
$string = str_replace("EMPTY","empt y",$string);
$string = str_replace("TRUNCATE","trunc ate",$string);


$string=nl2br($string);
return $string;
}

function smiley($string)
{
$smiles=array('(manu)'=>"<img src='$config->url/addons/smileys/manchester.jpg' alt='(manu)'/>",
'(chelsea)'=>"<img src='$config->url/addons/smileys/chelsea.png' alt='(chelsea)'/>",
'(spam)'=>"<img src='$config->url/addons/smileys/spam.gif' alt='(spam)' />",
'(welcome)'=>"<img src='$config->url/addons/smileys/welcome.gif' alt='(welcome)' />",
'(ban)'=>"<img src='$config->url/addons/smileys/ban.gif' alt='(ban)' />",
'(celebration)'=>"<img src='$config->url/addons/smileys/celebration.gif' alt='(celebration)' />",
'(admin)'=>"<img src='$config->url/addons/smileys/admin.gif' alt='(admin)' />",
'(anyone)'=>"<img src='$config->url/addons/smileys/anyone.gif' alt='(anyone)' />",
'(arsenal)'=>"<img src='$config->url/addons/smileys/arsenal.png' alt='(arsenal)' />",
'(barca)'=>"<img src='$config->url/addons/smileys/barca.jpeg' alt='(barca)' />",
'(cheesy)'=>"<img src='$config->url/addons/smileys/cheesy.gif' alt='(cheesy)' />",
'(cool)'=>"<img src='$config->url/addons/smileys/cool.gif' alt='(cool)' />",
'(cry)'=>"<img src='$config->url/addons/smileys/cry.gif' alt='(cry)' />",
'(drunk)'=>"<img src='$config->url/addons/smileys/drunk.gif' alt='(drunk)' />",
'(goodnight)'=>"<img src='$config->url/addons/smileys/goodnight.gif' alt='(goodnight)' />",
'(huh)'=>"<img src='$config->url/addons/smileys/huh.gif' alt='(huh)' />",
'(lies)'=>"<img src='$config->url/addons/smileys/lies.gif' alt='(lies)' />",
'(liverpool)'=>"<img src='$config->url/addons/smileys/liverpool.gif' alt='(liverpool)' />",
'(lol)'=>"<img src='$config->url/addons/smileys/lol.png' alt='(lol)' />",
'(love)'=>"<img src='$config->url/addons/smileys/love.png' alt='(love)' />",
'(love2)'=>"<img src='$config->url/addons/smileys/love-flower.gif' alt='(love2)' />",
'(madrid)'=>"<img src='$config->url/addons/smileys/real.png' alt='(madrid)' />",
'(tongue)'=>"<img src='$config->url/addons/smileys/tongue.gif' alt='(tongue)' />",
'(nicethread)'=>"<img src='$config->url/addons/smileys/nicethread.gif' alt='(nicethread)' />");

$string=str_replace(array_keys($smiles), array_values($smiles), $string);
return $string;
}

function mygeneral($limit)
{
$query=mysql_query("SELECT * FROM b_gupdates ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center></center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<div id='posts'><li><center>$prefix <a href=$url>$title</a></center></li></div>";
}
echo"</ul>";
}
}
function mygeneral2($limit)
{
$query=mysql_query("SELECT * FROM b_gupdates2 ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center>Exclusive From General Discussion forum</center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<li><center><font color='white'>$prefix</font> <a href=$url>$title</a></center></li>";
}
echo"</ul>";
}
}

function mymobile($limit)
{
$query=mysql_query("SELECT * FROM b_iupdates ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center></center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<div id='posts'><li><center>$prefix <a href=$url>$title</a></center></li></div>";
}
echo"</ul>";
}
}
function mymobile2($limit)
{
$query=mysql_query("SELECT * FROM b_iupdates2 ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center>Exclusive From Browsing Village</center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<li><center><font color='white'>$prefix</font> <a href=$url>$title</a></center></li>";
}
echo"</ul>";
}
}

function myevent($limit)
{
$query=mysql_query("SELECT * FROM b_eupdates ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center></center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<div id='posts'><li><center>$prefix <a href=$url>$title</a></center></li></div>";
}
echo"</ul>";
}
}
function fblike()
{
echo"<div class='info_post'><div align='right'><font color='yellow'>Are You A Candidate?:-</font> <a href='http://joyloaded.com/ebook/examzone.php'><font color='cyan'>Clear Your Jamb, Waec, Gce, Neco Exam In One Sitting Here</font></a></div> ";
}
function myevent2($limit)
{
$query=mysql_query("SELECT * FROM b_eupdates2 ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center>Exclusive School Concerts</center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<li><center><font color='white'>$prefix</font> <a href=$url>$title</a></center></li>";
}
echo"</ul>";
}
}

function mymusic($limit)
{
$query=mysql_query("SELECT * FROM b_mupdates ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center></center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<div id='posts'><li><center>$prefix <a href=$url>$title</a></center></li></div>";
}
echo"</ul>";
}
}
function mymusic2($limit)
{
$query=mysql_query("SELECT * FROM b_mupdates2 ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center>Exclusive Musics</center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<li><center><font color='white'>$prefix</font> <a href=$url>$title</a></center></li>";
}
echo"</ul>";
}
}
function myupdate($limit)
{
$query=mysql_query("SELECT * FROM b_updates ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red'><center></center></font></h3><ul>";
while($uinfo=mysql_fetch_array($query))
{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<div id='posts'><li><center>$prefix <a href=$url>$title</a></center></li></div>";
}
echo"</ul>";
}
}


function myupdates($limit)
{
global $user;
$query=mysql_query("SELECT * FROM b_updates ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{
echo"<div class='msg'>No updates yet</div>";
}
else
{
echo"<h3><font color='red' size='6'><center><u> Exclusive Updates</b></u></center></font></h3><ul>";
echo" <br/><font color='cyan'>Our downloads now Working =></font><br><img src='../images/mp3.png' width='21' height='21'/>Music <b><a href='../music'><font color='red'>HERE</font></a></b> | <img src='../images/vid_icon.png' width='21' height='21'/>Movies <b><a href='../movies'><font color='yellow'>HERE</font></a></b> | <img src='../images/software_installer.png' width='21' height='21'/>Downloads <b><a href='../upload'><font color='red'>HERE</font></a></b>  | <img src='../images/pc_video.png' width='21' height='21'/>PC Videos <b><a href='../video'><font color='red'>HERE</font></a></b><br/><hr/>";
while($uinfo=mysql_fetch_array($query))

{
$prefix=$uinfo["prefix"];
$title=$uinfo["title"];
$url=$uinfo["url"];
echo"<b><li><center>$prefix <a href=$url style='color:yellow'>$title</a></center></li></b>";
}
echo"</ul>";
}
}
function get_size($size)
{
if($size<1024) $size=$size.'B';
if($size>1024 AND $size<1048576) $size=round($size/1024, 1).'KB';
if($size>=1048576) $size=round(($size/1024)/1024, 1).'MB';
return $size;
}

function updateonline()
{
global $user;
$time=time();
$uinfo=mysql_fetch_array(mysql_query("SELECT * FROM b_users WHERE username='$user'"));
mysql_query("UPDATE b_users SET lasttime='$time' WHERE username='EXPERT'");
$tsgone=$uinfo["tsgone"];
$oldtime=$uinfo["oldtime"];
$checktime=date("U")-200;
mysql_query("UPDATE b_users SET lasttime='$time' WHERE username='$user'");
if($tsgone<$checktime)
{
mysql_query("UPDATE b_users SET tsgone='$time', oldtime='$tsgone'");
}
}

function shoutbox($limit)
{
$query=mysql_query("SELECT * FROM b_shout ORDER BY id DESC LIMIT $limit");
$num=mysql_num_rows($query);
if($num==0)
{ echo"<div id='site-alert'><li><center>JL Search Engine <form action='http://www.google.com/m/search'>
<input type='hidden' name='as_sitesearch' value='www.joyloaded.com'>
<input type='text' name='q' class='search'>
<input type='submit' name='search' value='Search'>
</form><b><font color='cyan'>Like us on Facebook </font><a href='http://fb.me/joyloaded'>HERE</a><br><b><font color='yellow'>For All Exam Runz </font><a href='../ebook/examzone.php'> HERE</a><br> <font color='cyan'>Follow us on Twitter </font><a href='http://twitter.com/joyloaded'>HERE</a></b></center></li></div>"; }
else {
echo"<div id='site-alert'>";
while($info=mysql_fetch_array($query))
{
$id=$info["id"];
$message=bbcode(smiley(strtolower(cleanvalues2($info["message"]))));$name=cleanvalues2($info["poster"]);
$uid=user_info($name, userID);
$checkid=mysql_num_rows(mysql_query("SELECT * FROM b_users WHERE userID=$uid"));
if(empty($uid)||$name<1)
$recent=date("U")-900;
$onlinecheck=mysql_num_rows(mysql_query("SELECT * FROM b_users WHERE userID='$uid' AND lasttime>'$recent'"));
if($onlinecheck>0) { $st=" <font color=\"green\">&diams;</font> "; } else {
$st=" <font color=\"red\">&diams;</font> "; }
$onlinecheck=user_info($name, online);
$plev=user_info($name, level);
if($plev==0) { $rnk='<img style="vertical-align:
middle" src="/images/novice.png"/>'; }
elseif($plev==1) {
$rnk='<img style="vertical-align:middle" src="
/images/crown2.png" />'; }
elseif($plev==2) {
$rnk='<img style="vertical-align:middle" src="
/images/crown3.png" />'; }
echo"<li>$st <a href='../profile.php?uid=$uid'>$rnk<font color='#ff6600'><b>$name</b></font></a><font color='white'><b>:-</b></font> $message <br><font color='#ffffff'><b><hr></font>
";
if($plv==2) { echo "<br><a href='/shoutbox.php?act=del&id=$id'><font color='white'>[X]</font></a>"; }
echo"</li>";
}
echo"</div>";
}
}

function atuser_search_name($user){
$atuser_q = mysql_query("SELECT * FROM b_users WHERE username = '$user'");
$atuser_n = mysql_num_rows($atuser_q);
$at = mysql_fetch_object($atuser_q);

if($atuser_n == 0)
{return "@$user";}
else
{return "@<a href='/profile.php?uid=$at->userID'>$at->username</a>";}
}

function atuser_name($matches){

while($m = $matches[2]){
return atuser_search_name($m);}
}

function at_user($text){
return preg_replace_callback("/([@] )([a-zA-z-0-9] )/", "atuser_name", $text);
}
?>