Torrent Trackers guides blog


All about torrent tracker ! Modifications , themes , mods , sources engines .

  • Home
  • About
  • Blog Map

Currently viewing and reading

Forum Users Online

Posted by vovqa in March 28th 2010  

Gives you the users browsing the forums only, like on this forums’ “users online” or the “active users” on the tracker.

You need to create another field in the users table as follows:

ALTER TABLE 'users' ADD 'forum_access' DATETIME NOT NULL AFTER 'last_access' ;
ALTER TABLE 'users' ADD INDEX ( 'forum_access' ) ; //upto you IF you do this step!


In forums.php find at around line 1491::

$forums_res = mysql_query("SELECT * FROM forums ORDER BY sort, name") or sqlerr(__FILE__, __LINE__);
 
stdhead("Forums");
 
print("<h1>Forums</h1>\n");

Above that add:

mysql_query("UPDATE users SET forum_access='" . get_date_time() . "' WHERE id={$CURUSER["id"]}");// or die(mysql_error());

Find on around line 1590:

print("</table>\n");
 
print("<p align="center"><a href="?action=search"><b>Search</b></a> | <a href="?action=viewunread"><b>View unread</b></a> | <a href="?catchup"><b>Catch up</b></a></p>");

Add after that:

$forum_t = gmtime() - 600; //you can change this value to whatever span you want
$forum_t = sqlesc(get_date_time($forum_t));
$res = mysql_query("SELECT id, username, class FROM users WHERE forum_access &gt;= $forum_t ORDER BY forum_access DESC") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
if ($forumusers) $forumusers .= ",\n";
switch ($arr["class"])
{
case UC_SYSOP:
case UC_ADMINISTRATOR:
case UC_MODERATOR:
$arr["username"] = "<font color="orange">{$arr["username"]}</font>";
break;
case UC_UPLOADER:
$arr["username"] = "<font color="#4040C0">{$arr["username"]}</font>";
break;
}
 
if ($CURUSER)
$forumusers .= "<a><b>{$arr["username"]}</b></a>";
}
if (!$forumusers)
$forumusers = "There have been no active users in the last 15 minutes.";
?&gt;
<br>
<table width="50%" border="1" cellspacing="0" cellpadding="5"><tr>
<td class="colhead" align="left">Active Forum Users</td></tr>
</tr><td class="text">
 
</td></tr></table>

If the last entries after the above is stdfoot(); ?> then you need to open a php tag before it like

under: Forum Mods
Tags: forum, Online, Users
Digg it Add to del.icio.us Stumble it add to technorati

Related Post

  • [codebox][/codebox] BBcode tag (March 31st, 2010)
  • Resize Large Images (March 26th, 2010)
  • Pager in subject (March 26th, 2010)
  • [video=] Tag (bbcode addition) (March 26th, 2010)

No Comment Received

Leave A Reply

Please Note: Comments maybe under moderation after you submit your comments so there is no need to resubmit your comment again

« Resize Large Images
[codebox][/codebox] BBcode tag »

Categories

    • Addon Mods (5)
    • Browse/Torrent/Details Mods (1)
    • Forum Mods (5)
    • Message/Email Mods (6)

Pages

    • About
    • Blog Map

Archives

    • March 2010 (17)

Tags

  • An intelligent announcement BBcode Category Manager easyiest script forum Images Multiplier No mail confirmation. Online Passkey Password Hint Simple mod simple script system Tbdev Upload Users video youtube like

Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Tags

  • An intelligent announcement BBcode Category Manager easyiest script forum Images Multiplier No mail confirmation. Online Passkey Password Hint Simple mod simple script system Tbdev Upload Users video youtube like

Recent Entries

  • [codebox][/codebox] BBcode tag
  • Forum Users Online
  • Resize Large Images
  • Pager in subject
  • Process Hit and Runers by ScarS
  • [video=] Tag (bbcode addition)
  • Set All Torrents FREE the easyiest script ive seen
  • Passkey by Skorpios
  • Category Manager Add/Edit/Delete/View
  • Comment Votes
  • Contact us/ submit query script
  • Password Hint (Fixed for FireFox & I.E
  • Color and text change of PM

Recent Comments

  • bastard in NoMail verification No mail confir…
  • bastard in Color and text change of PM
  • bastard in Password Hint (Fixed for FireFox &…
  • bastard in Contact us/ submit query script
  • lol in Comment Votes

Most Comments

  • Comment Votes (1)
  • Contact us/ submit query script (1)
  • Password Hint (Fixed for FireFox & I.E  (1)
  • Color and text change of PM (1)
  • NoMail verification No mail confirmation.  (1)
©2010 Torrent Trackers guides blog
Powered by WordPress 3.0.1    Valid XHTML    Valid CSS