Basically, I didn't like to show Top 5 all the time. (Heck they could be dominating the top 5 forever). So instead I chose to have recent visitor. Here's how you do.
Create a new file: create a new file: /templates/templatename/sidebar_modules/sidebar_topuser.tpl
Code:
<div class="tlb">
<a href="topusers.php"><h2>Currently Online</h2></a></div>
<div>
<ul style="list-style:none;">
{php}
global $db;
$sql="SELECT user_login from " . table_users . " order by user_lastlogin desc limit 0,25";
$result = @mysql_query ($sql);
$rowCount = 0;
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$uname=$row['user_login'];
if (($rowCount++)%2 == 0)
echo "<a href='" . getmyurl('user2', $uname, 'profile') . "'><img src='". get_avatar('large', "", "$uname","","")."' style='padding:0px 0px 3px 3px'></a>";
else
echo "<a href='" . getmyurl('user2', $uname, 'profile') . "'><img src='". get_avatar('large', "", "$uname","","")."' class='align-middle' style='padding:0px 0px 3px 3px'></a>";
}
{/php}
</ul>
</div>
{assign var=sidebar_module value="sidebar_topuser"}{include file=$the_template_sidebar_modules."/wrapper.tpl"}
You can have a look at Negaraku! for this mod (live).
I'm still unsure of how to make it look nicer or at least use proper CSS.
Code:
$sql="SELECT user_login from " . table_users . " order by user_lastlogin desc limit 0,25";
Don't ask me mysql or php question, I have very minimal knowledge on that area





Linear Mode

