Parašė Dandžu· 2008 Geg. 18 22:05:47
#5
Še.
<?
function getRank($id_user) {
$datat = dbquery("SELECT * FROM ".DB_PREFIX."users WHERE user_id='".$id_user."' LIMIT 1");
$data = dbarray($datat);
$u_post = $data['user_posts'];
if($data['user_groups'] != '' OR $data['user_level'] == '102' OR $data['user_level'] == '103'){
$extrarang = dbquery("SELECT * FROM ".DB_PREFIX."forumrang_extra WHERE typ=".$data['user_level']." OR typ='".str_replace(".", "' OR typ='", substr($data['user_groups'], 1))."' LIMIT 1");
$extrarangab = dbarray($extrarang);
$rows = dbrows($extrarang);
if ($rows != 0) {
$rangret = "".$extrarangab['name']."";
for($q=1;$q <= $extrarangab['anz'];$q++){
$rangret .= "";
}
$rangret .= "<br>";
}
else{
$res = dbquery("SELECT * FROM ".DB_PREFIX."forumrang WHERE posts >= '".$u_post."' ORDER BY posts ASC LIMIT 1");
$rank = dbarray($res);
$bil = dbquery("SELECT * FROM ".DB_PREFIX."forumrang_bilder WHERE id='".$rank['id']."' LIMIT 1");
$bild = dbarray($bil);
$rangret = "".$rank['rank']."";
for($q=1;$q <= $bild['anz'];$q++){
$rangret .= "";
}
$rangret .= "<br>";
}
}
else{
$res = dbquery("SELECT * FROM ".DB_PREFIX."forumrang WHERE posts >= '".$u_post."' ORDER BY posts ASC LIMIT 1");
$rank = dbarray($res);
$bil = dbquery("SELECT * FROM ".DB_PREFIX."forumrang_bilder WHERE id='".$rank['id']."' LIMIT 1");
$bild = dbarray($bil);
$rangret = "".$rank['rank']."";
for($q=1;$q <= $bild['anz'];$q++){
$rangret .= "";
}
$rangret .= "<br>";
}
return $rangret;
}
?>