SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: arkiebiker on April 01, 2010, 05:51:01 PM

Title: Online Today Block
Post by: arkiebiker on April 01, 2010, 05:51:01 PM
I have a mod for SMF which shows the USERS ONLINE TODAY at the bottom of my forum page. I would like to put that in a block.

I did have it working in block before SMF 2.0 RC3, but now it does not work.

Has anyone tried to make this block before?

Here is the previous code I had...I am hoping maybe it is just something really easy to fix...if someone cares to look at it.

Thanks,

Wally

Code: [Select]
global $db_prefix, $scripturl;

// How many do you want to display?
$limit = 25;

// Adjustment to time -- If the time displayed is not correct, enter how many hours it needs to be adjusted by.
$time_adjust = 3;

$result = db_query("SELECT realName, ID_MEMBER, lastLogin
FROM {$db_prefix}members
ORDER BY lastLogin DESC
LIMIT $limit", __FILE__, __LINE__);

echo '<table>';
while ($row = mysql_fetch_assoc($result)){
$time = $row['lastLogin'] + ($time_adjust * 3600);
echo '
<tr>
<td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a></td>
<td>' . date('H:i',$time) . '</td>
</tr>';
}
echo '</table>';
mysql_free_result($result);
SimplePortal 2.3.8 © 2008-2024, SimplePortal