MyBB Community Forums

Full Version: Changing Default Forumbit in forumlist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm currently in the process of developing a plugin that will allow me to change which forumbit templates are used for my forums based on a specific forum setting.

Essentially, my forums can be checked as either "A" or "B". I'm trying to hook into the functions_forumlist to change the $forum_list eval so get $templates->forumbit_a_ or $templates->forumbit_b.

Trying to just change the eval with an if/else statement doesn't seem to work, nor can I get access to the $forumcat or $depth variables to tack a prefix on to those.

Here's the code:
$plugins->add_hook("build_forumbits_forum", "plugin_forumbits");
function plugin_forumbits($forum)
{
	global $mybb, $templates;
	
	if($forum['type_a'] == 1) {
		eval("\$forum_list .= \"".$templates->get("forumbit_depth$depth$forumcat_a")."\";");
	}
	else {
		eval("\$forum_list .= \"".$templates->get("forumbit_depth$depth$forumcat")."\";");
	}
}

I have been able to accomplish this by directly editing the functions_forumlist.php file, but I wanted to see if I could make it a plugin instead.

Thanks in advance for any help.
Bumping this. If anybody has any ideas, I'd love to hear them.

For the sake of moving on with the rest of the plugin, I've gone ahead and just made the core file edit (the if/else statement in the above code). I just find it hard to believe that a plugin system as powerful as myBB's can't handle this kind of thing.