MyBB Community Forums

Full Version: How to make the rules of forum was shown in the thread?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,

I just test the rules of forum, but it seems that when I open a thread, the rules was not shown. How to make the rules was shown after openning the thread.Smile

Thanks for any help.
They only show on the forum display...
(2009-12-29, 01:26 PM)MattRogowski Wrote: [ -> ]They only show on the forum display...

Thanks a lot.
Smile
I think you can make this quite simply...

In showthread.php, find:
$forumpermissions = forum_permissions($forum['fid']);
After that, add:
// Do we have any forum rules to show for this forum?
$foruminfo = $forum;
$forumrules = '';
if($foruminfo['rulestype'] != 0 && $foruminfo['rules'])
{
	if(!$foruminfo['rulestitle'])
	{
		$lang->load("forumdisplay");
		$foruminfo['rulestitle'] = $lang->sprintf($lang->forum_rules, $foruminfo['name']);
	}
	
	$rules_parser = array(
		"allow_html" => 1,
		"allow_mycode" => 1,
		"allow_smilies" => 1,
		"allow_imgcode" => 1
	);

	$foruminfo['rules'] = $parser->parse_message($foruminfo['rules'], $rules_parser);
	if($foruminfo['rulestype'] == 1)
	{
		eval("\$forumrules = \"".$templates->get("forumdisplay_rules")."\";");
	}
	else if($foruminfo['rulestype'] == 2)
	{
		eval("\$forumrules = \"".$templates->get("forumdisplay_rules_link")."\";");
	}
}

And then use $forumrules in the showthread template. Haven't tested this but it should work...