Changing Default Forumbit in forumlist
jshort Offline
Junior Member
**
Posts: 3
Joined: Aug 2013
Post: #1
Changing Default Forumbit in forumlist
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:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
$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.

I'm aware that xthreads has this capability, but the xthreads plugin is overkill for what I'm trying to accomplish. I would also like to avoid putting conditionals in all the individual templates.

Thanks in advance for any help.

Edit: Not sure who changed the topic title of my request - but Threaded Mode | Linear Mode isn't what I'm talking about.

(This post was last modified: 08-13-2013 06:15 AM by jshort.)
08-13-2013 02:33 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Changing Default Forumbit in forumlist - jshort - 08-13-2013 02:33 AM

 Standard Tools
Forum Jump: