MyBB Community Forums

Full Version: Navigation Bar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So, I'm trying to change the navigation through a plugin, currently MyBB only offers to change either or depending on the users status (logged in/mod/admin). Well, that is as far as I know at least. However, I would need the navigation bar to change as well upon login, however the plugin API is giving me a hard time doing so.

Instead of the navigation un-ordered list, I added a {$artanav} variable to replace with an eval(). However it does not work.

I'm adding it to the global_intermediate hook, which is before the navigation is added to the site. And in this hook function, I run the eval() function.


function plugin_utilities_global()
{
	global $templates;
	
	eval("\$artanav = \"".$templates->get("plugin_artakus_navigation_guest")."\";");
}

I did check if the template actually exists after activating my plugin, and it does. I also checked if it runs the function plugin_utilities_global(), and it does that as well. So my question remains; why does the eval do nothing? The navigation doesn't change.

If anyone could help me solve this, it would be greatly appreciated! And yes, I'm rather new to the MyBB plugin development topic, so please keep that in mind.

Again I managed to solve this my self. I was a dumbass and forgot to add my variable to the global.