Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2008, 03:57 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default WOL locations for sub-pages

I know how to create custom WOL locations but How do we create custom online locations for sub-pages like I want the exact location to display when user is viewing page.php?do=this&uid=12

For example, this is the WOL code of ibproarcade:-

Hook: online_location_unknown

PHP Code:
if ($userinfo['activity'] == 'arcade')
{
    
$gameid =& $userinfo['gameid'];
    global 
$wol_games;
    
$gametitle =& $wol_games["$gameid"];
    switch(
$userinfo['values']['do']) 
    {
        case 
'play':
            
$userinfo['action'] = $vbphrase['ibproarcade_playing_game'];
            
$userinfo['where'] = '<a href="arcade.php?' $vbulletin->session->vars['sessionurl'] . "do=play&amp;gameid=$gameid\">$gametitle</a>";
            break;
        case 
'stats':
            
$userinfo['action'] = $vbphrase['ibproarcade_viewing_highscores'];
            
$userinfo['where'] = '<a href="arcade.php?' $vbulletin->session->vars['sessionurl'] . "do=stats&amp;gameid=$gameid\">$gametitle</a>";
            break;
        default:
            
$userinfo['action'] = $vbphrase['ibproarcade_viewing_home'];
            
$userinfo['where'] = '<a href="arcade.php' $vbulletin->session->vars['sessionurl_q'] . "\">$vbphrase[ibproarcade_home]</a>";
            break;
    }
    
$handled true;
DEVDEBUG("gameid = " $userinfo['gameid']);


Hook: online_location_process

PHP Code:
if (($filename == 'arcade.php') || ($filename == 'holdsession.php'))
{
    
$userinfo['activity'] = 'arcade';
    if (!empty(
$values['gameid']))
    {
        
$userinfo['gameid'] = intval($values['gameid']);
        global 
$gameids;
        
$gameids .= ',' $userinfo['gameid'];
    } 


Can anybody explain me how its done? Thanks
Reply With Quote
  #2  
Old 11-22-2008, 07:13 PM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure you'll be able to unless you can define the subpage with a unique script name.
Reply With Quote
  #3  
Old 11-22-2008, 07:26 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is why I posted the arcade's WOL code as an example and I have seen few other mods as well. It can surely be done with switch case, just need to understand how to start. How are those vars defined like that?

--------------- Added [DATE]1227409484[/DATE] at [TIME]1227409484[/TIME] ---------------

alright so switch case is working good for me, just the variable thing for $userinfo['where'] is required. Can anybody tell me how to make my variables available there so I can write my URL's.

Thanks
Reply With Quote
  #4  
Old 11-24-2008, 08:50 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anybody... is shouldn't be tough !
Reply With Quote
  #5  
Old 11-24-2008, 02:46 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you try to write it yourself based on the arcade code example? Perhaps if you post your code for the two plugins then people can help you.
Reply With Quote
  #6  
Old 11-24-2008, 03:12 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OFCOURSE, i always try things 20 times before asking here.

My code is as simple as in any article of WOL here, ALSO, arcade's code helped me to define locations for sub-pages BUT how to make the URL variables available for $userinfo['where'].

My code:-

Hook: online_location_process

Code:
if ($filename == 'myfile.php')
{
        $userinfo['activity'] = 'myprocess';
}

Hook: online_location_unknown

Code:
if ($userinfo['activity'] == 'myprocess')
{
    switch($userinfo['values']['do']) 
    {
        case 'view':
            $userinfo['action'] = 'Viewing Item';
            $userinfo['where'] = 'I NEED HELP WITH THIS'
            break;
        default:
            $userinfo['action'] = 'Vewing Custom Page';
            break;
    }
        $handled = true;
}

The switch case is working good. BUT how to build the URL in userinfo[where]. How to make the variables available there just like arcade's code gameid and gametitle variables

Thanks
Reply With Quote
  #7  
Old 11-26-2008, 02:14 AM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There was already a wonderful article here that helped me achieve this in few minutes
https://vborg.vbsupport.ru/showthread.php?t=113725

Thanks to siradrian
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 02:37 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03987 seconds
  • Memory Usage 2,239KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete