$rz = 1; if($url[2] == 'clans') { $rz = 3; }elseif($url[2] == 'referal') { $rz = 2; } ?>
№ | рейтинг | ||||||
'.$i.' | '.$u->microLogin($pl['id'],1).' | '.$pl['rep3'].' | '; $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.' | Ур. '.$pl['level'].' '.$pl['name'].' | '.$pl['exp'].' | '; $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 = ' | ||||
'.(count( $rk )-$i).' | '.$u->microLogin($rk[$i],1).' | '.$rf2[$rk[$i]].' ( '.$rf1[$rk[$i]].' чел. ) | '.$r; $i++; } $r .= 'Активных рефералов: '.$mas.' чел. | ||||