View Full Version : using plugins to display community drop down links
need2fart
06-12-2011, 12:24 AM
I'm trying to display a link inside the "community" drop down menu.
So I added a global_setup_complete plugin with the contents:
eval('$template_hook[\'navbar_community_menu_end\'] .= "<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/ideas/ideas.php">Submit ideas</a></td></tr>"');
But it doesn't exactly work.
How can I properly display a link inside the community drop down button? Do I also need to "cache_templates" or something?
Thank you.
BirdOPrey5
06-12-2011, 12:43 AM
I don't know why you're using eval()??
Just remove the eval... fix the quotes... Use this code:
$template_hook['navbar_community_menu_end'] .= '<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/ideas/ideas.php">Submit ideas</a></td></tr>';
On the hook: parse_templates
need2fart
06-12-2011, 08:00 AM
I don't know why you're using eval()??
Just remove the eval... fix the quotes... Use this code:
$template_hook['navbar_community_menu_end'] .= '<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/ideas/ideas.php">Submit ideas</a></td></tr>';
On the hook: parse_templates
Thanks a lot BOP! Haha I just copied the code from the experience plugin and was using that as a guide to displaying another link in the community drop down. I have no idea was eval() is lol so I don't know either! I'm a fail copy cat.
Well thanks a lot tho for helping me with plugins. ^.^
BirdOPrey5
06-12-2011, 10:55 AM
For future reference eval() is actually a pretty dangerous php function opening yourself up to hacking attempts if you don't know exactly what you are doing. You should avoid it in the future as much as possible, especially if you're not experienced.
It takes any text and evaluates it as if it was php code. When using eval() you need to put safe guards in place to make sure the text it gets could not possibly be dangerous or altered by the user.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.