MyBB Community Forums

Full Version: How to put FID in php IF
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
OK. I need you to explain me the way how to put FID in IF.

Quote:IF forum ID = 15 than do that and this

I tink its something like this

if($mybb->input['fid'] == 19) {echo something}

But it doesn't work
It probably depends on which hook you are using to accomplish this. Can you give a little more detail of what you are trying to do and where you are trying to do it at?
That is a code in class_parser.php and thats make that guests can't see links in all forums - I want to make that guests can see links only in one forum

	// First we split up the contents of code and php tags to ensure they're not parsed.
			
			if($mybb->user['uid'] == 0)
				{
				preg_match_all("#\[(code|php)\](.*?)\[/\\1\](\r\n?|\n?)#si", $message, $code_matches, PREG_SET_ORDER);
				$message = preg_replace("#\[(code|php)\](.*?)\[/\\1\](\r\n?|\n?)#si", "<br><b>[size=x-large]Please register or login to see links![/size]</b><br>", $message);
				}
				else
				{
				preg_match_all("#\[(code|php)\](.*?)\[/\\1\](\r\n?|\n?)#si", $message, $code_matches, PREG_SET_ORDER);
				$message = preg_replace("#\[(code|php)\](.*?)\[/\\1\](\r\n?|\n?)#si", "<mybb-code>\n", $message);
				}
		}

I want to add one more condition in IF
if($mybb->input['fid'] == 19) {echo something} 
Please help me I need this
Well the input fid would only work if the URL actually says ?fid=19

For threads and thus for the place where the links usually are this wouldn't be the case. That's why it depends on which hook or which place or which page you're actually doing this. For some locations input fid works, for other locations you have to use $thread['fid'] and some other places you even have to look up the fid manually yourself if MyBB itself isn't interested in any fid in that place...