vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   using plugins to display community drop down links (https://vborg.vbsupport.ru/showthread.php?t=265064)

need2fart 06-12-2011 12:24 AM

using plugins to display community drop down links
 
I'm trying to display a link inside the "community" drop down menu.

So I added a global_setup_complete plugin with the contents:

Code:

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:
PHP 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

Quote:

Originally Posted by BirdOPrey5 (Post 2206458)
I don't know why you're using eval()??

Just remove the eval... fix the quotes... Use this code:
PHP 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.


All times are GMT. The time now is 04:24 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
  • Page Generation 0.00940 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete