Very good discussion and imo the first post and info that follows by everyone else makes this worthy of being a Article! I moved this thread here to the articles forum, there is a 7 day redirect link in programming discussions and normally I don't do redirects but just in case some look there first in the next few days ;).
|
Try commenting out the $result line at the bottom. I don't know if that will work in that hook.
|
Quote:
Code:
global $show; |
Quote:
Hook: build_navigation_array Code: PHP Code:
|
A while back I commented about using the database method for adding things to the navigation menu and nobody has shown how to do that.
So, here's my method broken out and heavily commented so it's easy to understand.... Code:
// ########## CREATE NEW NAVIGATION ITEMS ########## |
What hook do they run it in?
|
Quote:
Thank you for your help. You code works, but only for one link. When i want to add more than 1 link, only the last is displayed. Tested with this code : PHP Code:
|
Quote:
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. |
Quote:
PHP Code:
|
Quote:
For guys who read : Add an id... |
All times are GMT. The time now is 10:35 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|