Рейтинг

0 AND `users`.`ip` != "" AND `users`.`banned` = 0 AND `users`.`online` > "'.(time()-14*86400).'" AND `users`.`ip` != "0" ORDER BY `rep`.`rep3` DESC LIMIT 100'); while($pl = mysql_fetch_array($sp)) { $r .= ''; $i++; } }elseif( $rz == 3 ) { $sp = mysql_query('SELECT * FROM `clan` WHERE `exp` > 0 ORDER BY `exp` DESC LIMIT 100'); while($pl = mysql_fetch_array($sp)) { $r .= ''; $i++; } }elseif( $rz == 2 ) { $rf_i = array(); $rf1 = array(); $rf2 = array(); $mas = 0; $sp = mysql_query('SELECT `host_reg`,`level` FROM `users` WHERE `host_reg` > 0 AND `banned` = 0'); while( $pl = mysql_fetch_array($sp)) { if( !isset($rf1[$pl['host_reg']])) { $usr = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "'.$pl['host_reg'].'" LIMIT 1')); if( isset($usr['id']) ) { $rf_i[] = $pl['host_reg']; $rf1[$pl['host_reg']] = 0; $rf2[$pl['host_reg']] = 0; } } if( isset($usr['id']) ) { $mas++; $rf1[$pl['host_reg']]++; $rf2[$pl['host_reg']] += $pl['level']; } } asort($rf2); $rk = array_keys($rf2); $i = 0; while( $i < count( $rk ) ) { $r = ''.$r; $i++; } $r .= 'Активных рефералов: '.$mas.' чел.
'; } echo $r; ?>
рейтинг  
'.$i.''.$u->microLogin($pl['id'],1).''.$pl['rep3'].'
'.$i.' Ур. '.$pl['level'].' '.$pl['name'].''.$pl['exp'].'
'.(count( $rk )-$i).''.$u->microLogin($rk[$i],1).''.$rf2[$rk[$i]].' ( '.$rf1[$rk[$i]].' чел. )
Рейтинг постоянно изменяется.