MyBB Community Forums

Full Version: Which template to edit?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello again,
I wanted to edit the template that displays the forums on the index page. In particular I wanted to get rid of the space between different categories and I wanted to only have the "Forums ---- Threads -- Posts -- Last Post" table heads be displayed once at the top.

Which template should I edit to do this? I tried looking at the index template but it seems to have a single variable $forums which displays all the forums? If anyone can point me in the right direction it would be much appreciated. Thank you!
Take a look at the forumbit templates. Wink
Great! THat's what I wanted. Now I'm having another problem heh.

How do I add php code into a template?

Specifically I want to have some if statements so that the forum header (i.e., forum--post-poster) info only appears for the first forum (fid==1)

right now I'm trying the following

<?php if($forum[fid] == 1){?>
<tr>
<td class="tcat" width="35">&nbsp;</td>
<td class="tcat" width="59%"><strong>$lang->forumbit_forum</strong></td>
<td class="tcat" width="65" align="center" nowrap="nowrap"><strong>$lang->forumbit_threads</strong></td>
<td class="tcat" width="65" align="center" nowrap="nowrap"><strong>$lang->forumbit_posts</strong></td>
<td class="tcat" width="200" align="center"><strong>$lang->forumbit_lastpost</strong></td>
</tr>
<?php } ?>

but I'm pretty sure that's not how to do it at all so if anyone can point me in the right direction it would be much appreciated.

You can't add any conditionals or PHP code to templates at the moment - MyBB uses a fairly simple parser at the moment which basically only understands variables.

You'll have to add your conditionals and code in the actual files and make references to the templates in those files.

Chris