[HowTo] Add Custom Pages to WOL
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:
Add the online_location_process hook plugin... Hook Location: online_location_process Name: WOL Online Location Process Active: YES Code: PHP Code:
Add the online_location_unknown hook plugin... Hook Location: online_location_unknown Name: WOL Online Location Unknown Active: YES Code: PHP Code:
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 |
Thank you for this Howto, I earlier made a request for a new hook location in the middle of the switch() at vBcom, but I guess I can just make myself a new switch inside those 2 locations.
I did think of this myself, but I found it to be a better idea to be able to plugin in the middle of the switch. We'll see what the devs do :) |
I thought that the logical place for this was in the switch too. But we can accomplish the same thing here.
My initial thought is that a hook in the switch would be more efficient then the bunch of if()'s this may create. This will evolve. There's always more then one way to skin a cat. ;) |
wow..
|
Quote:
You could just add another switch statement in your plugin code instead. a few ifs wont slow the page down. |
"a few"? You obviously have not seen the WOL location list for the RPG hack :p
Not saying it WILL slow it down, just saying that a hook in the middle of the switch as well would be more useful. |
Quote:
PS i agree a hook at that spot would be welcomed. |
Erm ... you can't put the hook "in the middle of the switch".
You can only put one above it, below, or in one (ore more) of the case: statements - and this is how it does currently work: The hooks are in case default:, eg. will be executed when there is an unknown location. Now if you have several custom locations put another switch there and everything is just fine. |
I agree, maybe if a plugin has multiple pages to deal with, it should be inside an if() and have it's own switch statement to make it efficient?
|
Quote:
Quote:
Remember before, when we edited the function to put in our own case:'s? That is what I mean. A hook that allows us to add case: instead of switch() in the default: |
All times are GMT. The time now is 03:03 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|