vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Custom WOL for a Specific Mod (https://vborg.vbsupport.ru/showthread.php?t=287849)

evenmonkeys 09-15-2012 12:26 AM

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!

kh99 09-21-2012 09:35 PM

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.

evenmonkeys 09-22-2012 01:19 AM

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?"

kh99 09-22-2012 01:38 AM

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'].

evenmonkeys 09-24-2012 02:49 AM

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


All times are GMT. The time now is 05:01 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.00981 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete