The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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! |
#2
|
|||
|
|||
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. |
#3
|
||||
|
||||
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?"
|
#4
|
|||
|
|||
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'; } 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']. |
#5
|
||||
|
||||
Ohhhhh. Very nice! Thank you! I didn't think about checking another condition.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|