PDA

View Full Version : This variable name?


Duckface
06-19-2015, 02:38 PM
Hi I'm looking for the variable name for the forum section id.

So example for the section: http://spawnscape614.co.uk/forums/forumdisplay.php?33-Request-Rank

Because I'm trying to make a condition based on which forum section it is?

MarkFL
06-19-2015, 02:47 PM
Try using:

if (in_array($fid, explode(',', $forum['parentlist'])))
{
//code to be executed here.
}

where $fid is the forumid of the section you want.

Duckface
06-19-2015, 02:56 PM
if (in_array($fid, explode('IDHERE?', $forum['parentlist'])))
{
//code to be executed here.
}

So in here?

Or

if (in_array($IDHERE, explode(',', $forum['parentlist'])))
{
//code to be executed here.
}

MarkFL
06-19-2015, 03:00 PM
No, you want to put it where $fid is...

Duckface
06-19-2015, 03:49 PM
No, you want to put it where $fid is...

Sorry if asking for help then. The ellipsis says all.

--------------- Added 1434736323 at 1434736323 ---------------

Thanks.

SPEEDKILLZ
06-19-2015, 04:11 PM
MarkFL knows his stuff.

MarkFL
06-19-2015, 04:56 PM
Sorry if asking for help then. The ellipsis says all.

I honestly meant nothing negative by the ellipsis...I use them all the time...perhaps too much...:D I also did not realize you had edited your second post.

You see, if I was going to check for a forumid of 6, I would use:

$fid = '6';

if (in_array($fid, explode(',', $forum['parentlist'])))
{
//code to be executed here.
}