The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Who's Online Additions
I've got a few custom pages floating around my forum, and I'd like to have them appear properly in the Who's Online (online.php) list.
Editing the functions_online.php is too easy, I'd much rather do it the proper way and use plugins (plus my edits won't be deleted the moment a vBulletin update overwrites the file). I've done very little work with plugins, but I'm quite confident with php. How would I add custom actions using plugins for the Who's Online list? |
#2
|
|||
|
|||
Go back to looking at the fuctions_online.php (construct_online_bit function) and in the big case statement (default handler) you will ind the following "hook":
PHP Code:
|
#3
|
|||
|
|||
I've tried that, but with each hook I received a php error stating that the "case" was unexpected.
|
#4
|
|||
|
|||
Ok. Trying to get a handle on how you are coding it.
Here's the default case where the hook sits... PHP Code:
PHP Code:
PHP Code:
Hows that looking, or have I missed something? |
#5
|
|||
|
|||
Yep that's exactly what I was doing.
I've also tried a number of if statements too, none of which did anything (literally ) |
#6
|
|||
|
|||
Ok,
How about this. Hook location: online_location_process Code:
if ($filename == 'yourfile.php') { $userinfo['activity'] = 'yourtitle'; } Hook location: online_location_unknown Code:
if ($userinfo['activity'] == 'yourtitle') { $userinfo['action'] = 'Viewing Your Page'; $userinfo['where'] = '<a href="./yourfile.php?' . $vbulletin->session->vars['sessionurl'] . '">Your Page</a>'; $handled = true; } |
#7
|
|||
|
|||
That worked PERFECTLY! Thanks very, VERY much!
|
#8
|
|||
|
|||
Excellent ! :up:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|