Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[HowTo] Add Custom Pages to WOL
noppid
Join Date: Mar 2003
Posts: 1,875

 

Florida
Show Printable Version Email this Page Subscription
noppid noppid is offline 06-10-2005, 10:00 PM

I'd like to suggest we follow the the way we did this in the past for the most part. We usually hacked into the two switch statements in the functions_online.php file. So staying with that convention, we can all easily coexist in the two necessary plugins will we need to use to accomplish this.

Why did I say coexist? Well based on this thread, multiple use of hooks, it seems it would be best to share a common plugin to a given hook location for now. That is if I understand it correctly.

So moving right along, this will help you create WOL plugins for your custom pages either way. If we all share a plugin or if we get a system that manages multiple plugins to a given hook, this should be a good example to follow when you need to display custom addin page WOL information.

There are two hook locations we need to add plugins to:
  • vBulletin : Who's Online? -> online_location_process
  • vBulletin : Who's Online? -> online_location_unknown

Add the online_location_process hook plugin...
Hook Location: online_location_process
Name: WOL Online Location Process
Active: YES
Code:
PHP Code:
if($filename=='YOUR_ADDIN_FILE.php'){$userinfo['activity'] = 'YOUR_ACTIVITY';} 

Add the online_location_unknown hook plugin...
Hook Location: online_location_unknown
Name: WOL Online Location Unknown
Active: YES
Code:
PHP Code:
if($userinfo['activity']=='YOUR_ACTIVITY')
{
    
$userinfo['where'] = '<a href="YOUR_ADDIN_FILE.php?'.$vbulletin->session->vars[sessionurl].'">'.$vbulletin->options[bbtitle].' YOUR_ACTIVITY</a>'
    
$userinfo['action'] = 'YOUR_ACTIVITY';
    
$handled true;


Following this convention should allow us to coexist in one plugin for each of those hooks or create good plugins for those hooks, either way.

I hope this is in the spirit of the howto forum and will be useful.

Regards
Reply With Quote
  #32  
Old 03-03-2007, 07:25 PM
Jon_Simmonds Jon_Simmonds is offline
 
Join Date: Nov 2005
Location: UK
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a couple of scripts I want to link to my WOL but the scripts are in subdomains, any suggestions or pointers on how to write the WOL plugin for this to work?
Reply With Quote
  #33  
Old 03-24-2007, 08:40 PM
Dream's Avatar
Dream Dream is offline
 
Join Date: Oct 2001
Posts: 2,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know you won't see this, but thank you worked like a charm
Reply With Quote
  #34  
Old 12-08-2008, 03:53 AM
ArnyVee's Avatar
ArnyVee ArnyVee is offline
 
Join Date: Mar 2008
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this method still the way to go?

Just making sure before I do some work on my custom pages
Reply With Quote
  #35  
Old 01-12-2009, 06:21 PM
vietfancy's Avatar
vietfancy vietfancy is offline
 
Join Date: Feb 2005
Posts: 278
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now that i can do something with my board.

Thanks
Reply With Quote
  #36  
Old 03-29-2009, 10:44 PM
shooterdfl's Avatar
shooterdfl shooterdfl is offline
 
Join Date: Feb 2009
Location: Washington State
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this, it works fine with the army and vbadvanced cmps mods. Using vbulletin 3.8.1.P1
Reply With Quote
  #37  
Old 05-09-2009, 01:37 AM
HG-ILUSION HG-ILUSION is offline
 
Join Date: Apr 2009
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ruinernix View Post
I coded this to show my index.php properly, so I don't have to edit vb's code.. may have to customize it for your own needs it's working for me... so I can show my pages from index.php and use hooks to properly name/show them. Hope it helps.

PHP Code:
require_once('global.php');
require_once(
'includes/functions_user.php');

if(
$vbulletin->userinfo['userid'] > 0
    
$location $vbulletin->db->query_first("SELECT location,sessionhash FROM " TABLE_PREFIX "session WHERE userid = ".$vbulletin->userinfo['userid']." ORDER BY lastactivity DESC LIMIT 1");
else
    
$location $vbulletin->db->query_first("SELECT location,sessionhash FROM " TABLE_PREFIX "session WHERE sessionhash = '".$vbulletin->session->vars['dbsessionhash']."' ORDER BY lastactivity DESC LIMIT 1");

if(
$location['sessionhash'] != "") {
    
$vbulletin->db->query_first("UPDATE " TABLE_PREFIX "session SET location = 'konspiracy.php?"$_SERVER["QUERY_STRING"] ."', lastactivity = '"TIMENOW ."' WHERE sessionhash = '"$location['sessionhash'] ."' LIMIT 1");
} else {
    
$vbulletin->db->query_first("INSERT INTO `session` ( `sessionhash` , `userid` , `host` , `idhash` , `lastactivity` , `location` , `useragent` , `styleid` , `languageid` , `loggedin` , `inforum` , `inthread` , `incalendar` , `badlocation` , `bypass` , `profileupdate` ) 
        VALUES ( '"
$vbulletin->session->vars['dbsessionhash']."', ".$vbulletin->userinfo['userid'].",  '".IPADDRESS."' , '".$vbulletin->session->vars['idhash']."', '".TIMENOW."', 'konspiracy.php?"$_SERVER["QUERY_STRING"] ."', '".$_SERVER["HTTP_USER_AGENT"]."', '0', '0', '1', '0', '0', '0', '0', '0', '0');");

How I can use this?

It says "Unknow location" but it works.

Thanks
Reply With Quote
  #38  
Old 09-20-2009, 10:24 PM
MagicThemeParks's Avatar
MagicThemeParks MagicThemeParks is offline
 
Join Date: Sep 2009
Posts: 850
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just followed the instructions and added the two plugins, but when I refresh the "Who's Online", it gives me a white screen with the following error....

Code:
Error 2 (net::ERR_FAILED): Unknown error.
....any ideas/suggestions on what I can do to fix this?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:13 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04213 seconds
  • Memory Usage 2,291KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete