MyBB Community Forums

Full Version: Show forum rules at top of each thread, but don't show if rules are blank
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I added this to threaddisplay template.

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>{$forum['rulestitle']}</strong></td>
</tr>
<tr>
<td class="trow1"><span class="smalltext">{$forum['rules']}</span></td>
</tr>
</table>
<br />

However, only a couple of forums have rules and it's displaying a blank table for forums without rules. Is there someway to get this to apply to only certain forums, or to tell it not to make the table if forum rules are blank?

Something like if forumid=#,#,# then display table, else don't. Or, if forumrules>blank then display table, else don't.
if you use template conditionals plugin then you can use code like below on the showthread template
<if  $forum['rules'] <> NULL then>
your code to display rules table
</if>
I had PHP and Conditionals already installed. But I can't even remember what I originally installed it for or if it's still otherwise in use. Big Grin So many plugins and changes made over time.

Regardless, this worked butter. Thanks again .m.

What code would I use if I wanted to restrict it to a certain forum(s)?, eg = <if current fid=#,#,# then>
^ code like below can be used to show the rules only for the specific forums' thread pages
<if  $forum['rules'] <> NULL && in_array($fid, array('x', 'y', 'z')) then>
your code to display rules table
</if> 
where x, y, z ... are the forum IDs for which rules to be shown on the thread pages