Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 09-15-2012, 12:26 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom WOL for a Specific Mod

I'm trying to figure out a way to create a WOL option for a modification that already exists: https://vborg.vbsupport.ru/showthread.php?t=92203

Dream made a plugin that just tells "index.php?page=example" to look for a template called "page_example" and displays it. I would like to make a WOL that instead of saying the user is viewing the "Forum Index," but that they're viewing the "Example" page.

If anyone could help, let me know. Thanks!
Reply With Quote
  #2  
Old 09-21-2012, 09:35 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This article has a section on adding a custom location: https://vborg.vbsupport.ru/showthread.php?t=228112

Edit: that's a vb4 article, but the location code will probably work in vb3.
Reply With Quote
  #3  
Old 09-22-2012, 01:19 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does that still work the same way for existing locations? For instance, "index.php" already points to "Viewing Forum Index." Can I force "index.php?page=something" to point to "Viewing Something Page?"
Reply With Quote
  #4  
Old 09-22-2012, 01:38 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It might. It doesn't look like index.php is handled in the existing code, so you should be able to check for $filename == 'index.php' and then use $values['page'] to check for the page.

Edit: Oh, I see you're saying it already says something for index.php. That's strange because I can't see where that's handled. So I'm not sure, but you could try to create a plugin that checks for index.php and see what happens.

OK, now I see why I missed it. The code uses $vbulletin->options['forumhome'] instead of using 'index.php' as a constant. So you're right, what's in that article won't work because index.php is already handled. But what I think you can do is create another plugin using hook online_location_preprocess and change $filename to something else, like:

Code:
if ($filename == 'index.php' AND isset($values['page']))
{
    $filename = 'custom_page_wrapper';
}
then in the other plugins, check $filename for that value.

Or you could add the page name in the above plugin code like:
Code:
if ($filename == 'index.php' AND isset($values['page']))
{
    $filename = 'custom_page_wrapper_' . $values['page'];
}

Then in the other plugins you only need to look at $filename and not $values['page'].
Reply With Quote
  #5  
Old 09-24-2012, 02:49 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ohhhhh. Very nice! Thank you! I didn't think about checking another condition.
Reply With Quote
Reply

Thread Tools
Display Modes

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:25 PM.


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.13543 seconds
  • Memory Usage 2,189KB
  • 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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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