Quote:
Originally Posted by Boofo
What hook do they run it in?
|
It can be run anywhere, in PHP code, or any other hook they want.
I use it in both PHP code for dynamic menus added by an admin from inside a mod and in the admin_options_processing_build hook for adding menus defined by the settings group for a mod.
If you use it in the admin_options_processing_build hook, add a !$settings['dummyvar'] condition at the beginning of the code and set $settings['dummyvar'] to 1 at the end of the code so it only runs once when the settings are updated.
Of course the variables would have to be gotten from the $settings['xyz'] values from the mod settings and/or some hard coded into the plugin.
EDIT: The advantage to using the database for menu items is there aren't any plugins required once the menu is created. vB itself will generate them for you at the proper time. That should be a BIG HINT for the discussion above and below this post that's revolving around a plugin to create a menu that on the surface appears to be a fixed menu that can accept variables (ie: {userinfo.userid} ). Create it once in settings or some other method and forget about it until it needs to change. Which I don't see that happening very often.
Code:
{options.toppath}search.php?do=finduser&userid={userinfo.userid}&starteronly=1&contenttype=vBForum_Thread
I do not suggest the database method for navigation items where the displayed text for the navigation item changes frequently (the name of the item ie: Forum or What's New) or where the link is not a fixed link with variables.