-$ADD = "userid";
-if (EXT_IS_ACTIVE("nickname")) $ADD = "nickname";
-$result = SQL_QUERY_ESC("SELECT userid, ".$ADD.", total_logins, last_online
-FROM "._MYSQL_PREFIX."_user_data
-WHERE total_logins>0 AND status='CONFIRMED' ORDER BY total_logins DESC LIMIT %s",
- array(getConfig('top10_max')), __FILE__, __LINE__);
-
-$OUT = ""; $SW = 2; $cnt = 1;
-while(list($uid, $nick, $logins, $last) = SQL_FETCHROW($result))
-{
- $nick2 = "---";
- if (($nick != $uid) && (!empty($nick))) $nick2 = $nick;
+$result = SQL_QUERY_ESC("
+SELECT
+ userid, total_logins, last_online
+FROM
+ {!_MYSQL_PREFIX!}_user_data
+WHERE
+ total_logins > 0 AND
+ `status`='CONFIRMED'
+ORDER BY
+ total_logins DESC
+LIMIT %s",
+array(getConfig('top10_max')), __FILE__, __LINE__);
+
+$OUT = ''; $SW = 2; $cnt = 1;
+while ($content = SQL_FETCHARRAY($result)) {
+ // Init nickname
+ $content['nickname'] = '---';
+
+ // Get nickname
+ if (EXT_IS_ACTIVE('nickname')) $content['nickname'] = NICKNAME_GET_NICK($content['userid']);