[Tutorial] Making the 'Rules' page to show with rules.
#6
Well, you said to remove a chunk of default code, which deals with the default functionality, normally, if you go to ./misc.php?action=rules&fid=81 then it would run the code you said to remove and show rules for that forum.

At the start it has elseif($mybb->input['action'] == "rules") for if you're loading ./misc.php?action=rules, and then, there's the if($mybb->input['fid']) bit, so if there's an fid, it runs the default code. However, if there wasn't an fid, it'd do nothing, hence the blank page. So, with my change, if the ($mybb->input['fid']) wasn't true, i.e. there wasn't an fid, the 'else' bit will show the bit you initially said to put in, the general rules.

Don't think I've explained that very well... this is what it would have been before:

if($page = rules)
{
	if($fid)
	{
		//code for the rules for requested forum
	}
}

Shows rules for the forum if there's an fid, nothing if there isn't one. You then said to just do this:

if($page = rules)
{
	//code to show general rules
}

That would mean if there was no fid it would show the general rules, but wouldn't show the rules from a forum if you gave an fid. I said to do:

if($page = rules)
{
	if($fid)
	{
		//code for the rules for requested forum
	}
	else
	{
		//code to show general rules
	}
}

Then, if there's an fid, it shows rules for that forum, if there isn't an fid, it shows the general rules.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply


Messages In This Thread
RE: [Tutorial] Making the 'Rules' page to show with rules. - by Matt - 2009-09-26, 07:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)