MyBB Community Forums

Full Version: Splitting Up Categories
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to have a gap between the categories of forums, but i'm not sure which bit of the template i need to edit to do this. I know its possible as I've seen it, but i cant rememeber where.
Admin CP > Templates > Modify/Delete > *template set name* > Forum bit Templates > Expand > forumbit_depth1_cat.

<table border="0" cellspacing="$theme[borderwidth]" cellpadding="$theme[tablespace]" class="tborder">
<tbody>
<tr>
<td class="tcat" colspan="5">
<div class="expcolimage"><a href="java script:expandCollapse('cat_$forum[fid]');"><img src="$theme[imgdir]/$expcolimage" id="cat_$forum[fid]_collapseimg" border="0" alt="[-]" /></a></div>
<div><strong><a href="forumdisplay.php?fid=$forum[fid]"><i>&raquo;</i> $forum[name]</a></strong><br /><div class="smalltext">$forum[description]</div></div>
</td>
</tr>
</tbody>
<tbody style="$expdisplay" id="cat_$forum[fid]_e">
$forums
</tbody>
<tbody style="$expdisplay" id="cat_$forum[fid]_e">
<tr>
<td class="tcat" width="5%">&nbsp;</td>
<td class="tcat" width="50%"><strong>$lang->forumbit_forum</strong></td>
<td class="tcat" width="10%" align="center" nowrap="nowrap"><strong>$lang->forumbit_threads</strong></td>
<td class="tcat" width="10%" align="center" nowrap="nowrap"><strong>$lang->forumbit_posts</strong></td>
<td class="tcat" width="25%" align="left"><strong>$lang->forumbit_lastpost</strong></td>
</tr>
$forums
</tbody>
<tr>
<td class="catfooter" colspan="5"></td>
</tr></table>
<br />

http://www.mybboard.com/community/showth...70#pid6270
Thanks, i tried that code, but i didnt quite work for me, i think it may be because i've already edited that template.

[attachment=391] is how it looked with the changes

Below is the code i had in the template, cos someone explain what i'd need to change to get it to work?
<tbody>
<tr>
<td class="tcat" colspan="5">
<div class="expcolimage"><a href="javascript:expandCollapse('cat_$forum[fid]');"><img src="$theme[imgdir]/$expcolimage" id="cat_$forum[fid]_collapseimg" border="0" alt="[-]" /></a></div>
<div><strong><a href="/?id=forum&amp;id2=forumdisplay&amp;fid=$forum[fid]"><i>&raquo;</i> $forum[name]</a></strong><br /><div class="smalltext">$forum[description]</div></div>
</td>
</tr>
</tbody>
<tbody style="$expdisplay" id="cat_$forum[fid]_e">
$forums
</tbody>
You may want to try downloading my Frostbite skin from the downloads area and see how I did it by looking at the templates. I can't remember off hand just how I did it....and I don't have a myBB installed on localhost at the moment.

Just a thought.
Thats where I got it from Toungue Perhaps there is another template that needs correcting??
Yeah, I get the same problem. The forums repeat themselves. I am no good with code so could someone help me out please?
Ok... here we go. Big Grin

Lets assume that everyone is using the default MyBB templates.. cause this is what im using for this example of how to split the categories up. Just follow the below example and you should end up with split categories at the end.



Alright.. go to your acp... access... ACP ==> Templates ==> Expand Default Templates. Find Index Page Templates and expand those. Next... Find the template titled "INDEX" and click Edit. Select everything inside of the said template and delete it... replacing the coding with below.






<html>
<head>
<title>$settings[bbname]</title>
$headerinclude
</head>
<body>
$header
$forums
$pms
<br />
<table border="0" cellspacing="$theme[borderwidth]" cellpadding="$theme[tablespace]" class="tborder">
<thead>
<tr>
<td class="thead">
<div class="expcolimage"><a href="javascript:expandCollapse('boardstats');"><img src="images/collapse$collapsedimg[boardstats].gif" id="boardstats_collapseimg" border="0" alt="[-]" /></a></div>
<div><strong><i>&raquo;</i> $lang->boardstats</strong></div>
</td>
</tr>
</thead>
<tbody style="$collapsed[boardstats_e]" id="boardstats_e">
$whosonline
$birthdays
$forumstats
</tbody>
</table>
<br />
<table border="0" cellspacing="$theme[borderwidth]" cellpadding="$theme[tablespace]" class="tborder">
<tr>
<td class="trow1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" align="left">
<table cellspacing="0" cellpadding="2" border="0">
<tr><td><img src="$theme[imgdir]/on.gif" alt="$lang->new_posts" /></td><td class="trow"><span class="smalltext">$lang->new_posts</span></td></tr>
<tr><td><img src="$theme[imgdir]/off.gif" alt="$lang->no_new_posts" /></td><td class="trow"><span class="smalltext">$lang->no_new_posts</span></td></tr>
<tr><td><img src="$theme[imgdir]/offlock.gif" alt="$lang->forum_locked" /></td><td class="trow"><span class="smalltext">$lang->forum_locked</span></td></tr>
</table>
</td>
<td valign="top" align="right">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td valign="top" align="right">
<span class="smalltext">$logoutlink<a href="misc.php?action=markread">$lang->markread</a> | <a href="showteam.php">$lang->forumteam</a> | <a href="stats.php">$lang->forumstats</a></span>
</td></tr>
$loginform
</table>
</td></tr>
</table>
</td></tr>
</table>
$footer
</body>
</html>






After replacing the said code with the above. Click Update Template. Thats it for that part.

Next... access... ACP ==> Templates ==> Expand Default Templates. Find Forum Bit Templates and expand those. Next... Find the template titled "forumbit_depth1_cat" and click Edit. Select everything inside of the said template and delete it... replacing the coding with below.







<table border="0" cellspacing="$theme[borderwidth]" cellpadding="$theme[tablespace]" class="tborder">
<tbody>
<tr>
<td class="tcat" colspan="5">
<div class="expcolimage"><a href="javascript:expandCollapse('cat_$forum[fid]');"><img src="$theme[imgdir]/$expcolimage" id="cat_$forum[fid]_collapseimg" border="0" alt="[-]" /></a></div>
<div><strong><a href="forumdisplay.php?fid=$forum[fid]"><i>&raquo;</i> $forum[name]</a></strong><br /><div class="smalltext">$forum[description]</div></div>
</td>
</tr>
</tbody>
<tbody style="$expdisplay" id="cat_$forum[fid]_e">
<tr>
<td class="thead" width="2%">&nbsp;</td>
<td class="thead" width="59%"><strong>$lang->forumbit_forum</strong></td>
<td class="thead" width="7%" align="center" nowrap="nowrap"><strong>$lang->forumbit_threads</strong></td>
<td class="thead" width="7%" align="center" nowrap="nowrap"><strong>$lang->forumbit_posts</strong></td>
<td class="thead" width="15%" align="center"><strong>$lang->forumbit_lastpost</strong></td>
</tr>
$forums
</tbody>
</table>
<br />



After replacing the said code with the above. Click Update Template. That should be it and you should have split categories now. *NOTE: Spliting the categories does give a differant feel and look to the forums... BUT... it will not work for forums which are not within a category (Stand alone forums). Iam still looking into methods to correct this... but havent come up with any thus far.. altho i have just started looking into it. I will let everyone know once i do come up with something to correct this.. if it hasnt already been corrected by the time of "GOLD" release by Chris.
Thanks a lot that works perfect! Well aside from when you minimize a catagoryit produces a error, no page found. Just thought you'd like to know for when if you intend on updating the code.
thanks for the code 2$CoMpLiCaTeD$4u, is working great, and my members love it.

but there is a problem, when you collapse the category, it takes you to a page that doesn't exist.
Sorry about that guys. If you follow below... everything should be fixed for you. Seems when i use the BB Code tag [ CODE ] it puts a space in between java and script.. oh well. Attached below you will find the fixed method. Just download the attachment and follow the instructions inside and you will be good to go.

[attachment=450]
Pages: 1 2