PDA

View Full Version : Miscellaneous Hacks - WOL - Threads


harmor19
05-21-2009, 10:00 PM
This add-on will show you what threads users are looking at in a specific forum rather than every user on your site when you visit the 'Who's Online' page.
Once install go to a forum, scroll down and if enabled via the vBulletin Options will be text that reads "Currently Active Users". Click on the text I have quoted on your forum to take you to the "Who's Online" list.


How to Install
Download the product XML. Go into to your ACP --> Plugins & Products --> Manage Products click "[Add/Import Product]". Browse to the product you have just downloaded and click "Import".


Template Edits
Open: FORUMDISPLAY
Find:
$vbphrase[currently_active_users]


Replace With
<a href="online.php?f=$foruminfo[forumid]">$vbphrase[currently_active_users]</a>



Open: WHOSONLINE
Find:
window.location="online.php?$session[sessionurl_js]order=$sortorder&sort=$sortfield&pp=$perpage&page=$pagenumber$refreshargs_js";

Replace With:

window.location="online.php?$session[sessionurl_js]order=$sortorder&sort=$sortfield&pp=$perpage&page=$pagenumber$refreshargs_js&$forumid";



Updates
1.0.0 - First Release
1.0.1 - optimized query, fixed reloading, fixed reload link.

harmor19
05-22-2009, 01:47 PM
I'm sorry if you do not understand how this mod works. I only work on a development forum and cannot link you to it so you can see how it works.

If someone could be kind enough to supply a demo I would appreciate it.

thincom2000
05-22-2009, 04:09 PM
Don't use ' around the number (it implies a string). This could result in a slow query because MySQL has to do a type conversion on the inforum column (SMALLINT to VARCHAR). If this weren't a full table scan already (which it is), the conversion would cause one, so make it a little easier on the server.

Also recommend having the product add inforum as a session table index to avoid the full scan.

harmor19
05-22-2009, 04:16 PM
Don't use ' around the number (it implies a string). This could result in a slow query because MySQL has to do a type conversion on the inforum column (SMALLINT to VARCHAR). If this weren't a full table scan already (which it is), the conversion would cause one, so make it a little easier on the server.

Also recommend having the product add inforum as a session table index to avoid the full scan.

Like this?

$currentforumid = $vbulletin->input->clean_gpc('r', 'f', TYPE_UINT);
$hook_query_fields = 'session.inforum';

$hook_query_where = empty($currentforumid) ? "" : "AND session.inforum = $currentforumid";

Stoebi
05-22-2009, 04:46 PM
$vbulletin->input->clean_gpc('p', 'f', TYPE_UINT);

$hook_query_fields .= ", session.inforum";
$hook_query_where .= empty($vbulletin->GPC['f']) ? '' : " AND session.inforum = " . $vbulletin->GPC['f'];
But IMHO the plugin is not needed. I see no difference with and without this plugin.

harmor19
05-22-2009, 05:20 PM
But IMHO the plugin is not needed. I see no difference with and without this plugin.

Go into a forum and scroll to the bottom. Click on "Currently Active Users".

Stoebi
05-22-2009, 05:26 PM
Yes, same result with and without plugin. IMHO the template-edit is enough ;)

Thanks *installed* :)

harmor19
05-22-2009, 06:45 PM
Updated the add-on.

Feanor_87
07-26-2009, 06:09 AM
Great, thanks! :)

mgurain
07-17-2010, 12:12 PM
Any screen shots ?

Mr.Mohammad
08-03-2010, 08:15 PM
Screen Shots ? !!!