MyBB Community Forums

Full Version: Alternating Category "theads"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hey!

I was wondering if it would be possible to create an alternating thead. Like right now there is {$altbg} for trow1 and trow2. Can someone make or tell me how to make a {$altcat} or something so I can have different colored categories as they alternate? Does anyone know what I mean? Here's sorta what I mean:
Now that's a top rate idea! I sure wish I knew how to do it.
Can you try this ? =P

HowTo:

Open /inc/functions.php

Add New Function
function alt_cat($reset=0)
{
	global $altcat;
	if($altcat == "cat1" && !$reset)
	{
		$cat = "cat2";
	}
	else
	{
		$cat = "cat1";
	}
	$altcat = $cat;
	return $cat;
}

Open ./inc/functions_forumlist.php

Find
	$forumcat = "_cat";

Add Below
			$catcolor = alt_cat();

Open Forum Bit Templates - forumbit_depth1_cat

Find
<td class="thead" colspan="5">

Change into
<td class="{$catcolor}" colspan="5">


Then add Additional CSS

Ex. [ Note ; Use cat1 and cat2 as classes ! ]
.cat1{
	background: #E4C57C;
}
.cat2{
	background: #918361;
}

Should result in something like this [ http://thingiej.be/mybb/ ], don't mind the colors , just filled in some random things ^^
Great work Lex- , thanks !
Thanks LeX-, I'll try this out on localhost. Big Grin
Amazing! Thanks a lot! Im gonna work on this a bit more, and stuff, and perhaps release a theme using this, credit to you for knowing how to do this XD.
Very nice but I doubt alot of people will use the themes made like this as it contains file changes. Many people just don't read the readme and just install it

Ill try it out though Toungue
*rcpalace bookmarks thread
buh =D Thought i had it as a full plugin, yet you need to add $catcolor as a global in the build_forumbits function =P Just that lil' word makes the differents ! =P
Cool LeX- i am going to try this out soon but for now i got to bookmark this.
Pages: 1 2 3