Quote:
Originally Posted by BirdOPrey5
But if it's not a static link? I'm supposed to tell user's to do it themselves now because vBulletin thinks they want more control over their navbar? Respectfully, most user's do not want total control, they want things done for them.
I've come up with this code, it's not efficient but it works, I will work on efficiency-
nhawk I know you mentioned making a database change but I prefer to avoid db edits if possible.
This example adds a link to Quick Links
No phrase needed.
On navigation_tab_complete hook:
PHP Code:
//Quick Links Add in 4.2.0 Start foreach ($tabdata AS $key => &$thistab) { if (is_array($thistab['children'])) { foreach ($thistab['children'] AS &$ttab) { if ($ttab['name'] == 'vbmenu_qlinks') { $nl['root'] = $key; $nl['type'] = 'link'; $nl['url'] = 'myfile.php'; $nl['title'] = 'Link Title'; $nl['name'] = 'custom_name_here'; $nl['children'] = 0; $ttab['children'][] = $nl; } } } } //Quick Links Add 4.2.0 END
Mind you that needs to be run for each new link which itself will likely be some kind of loop.
|
I thought of doing it that way, an actually had it done that way. But then there's no control by the admin as to where it goes (as pointed out by Andreas) and I changed to the DB write.
The advantage of doing it in the DB is the admin can move it around to any menu once it's created. After working with it a bit, I found management really isn't difficult. It's only a couple of DB writes at application type creation (in my mod) and then I'm done with it. No need to parse out a special template or anything else in vB 4.2.
And the nice thing is that when the product is uninstalled, the navigation and phrase info gets deleted like it should.