First off your adding alot of queries. Every user needs to run those queries to view the block so lets get rid of the two above. In the bloc above this section you posted look for the main query call to the session table and change that with this one:
|
Code:
|
$result = $db->sql_query("SELECT s.uname, s.guest, u.user_id, u.username, u.user_ranksmall FROM $prefix"._session." AS s LEFT JOIN ".$prefix."_users AS u ON u.username = s.uname WHERE guest='0'"); |
Now we have them all in one query. Now for the ranking you will need to make either another table or another field to associate what rank is what and what order they should list in. Hope that helps.
Telli