PDA

View Full Version : Forum Array


wolfe
10-18-2007, 02:41 PM
i have 5 forums in a vboption sepereated by commas (,)

and i use this code but its only working for the first forum in the list.


if (in_array($foruminfo['forumid'], array($vbulletin->options['info_forumids'])))
{
eval('print_output("' . fetch_template('newinfo') . '");');
} else {
eval('print_output("' . fetch_template('newthread') . '");');
}


is it right

Opserty
10-18-2007, 03:02 PM
<a href="http://uk3.php.net/explode" target="_blank">http://uk3.php.net/explode</a> Might be what you are looking for, then you can use in_array() with the returned value.

Mosh
10-19-2007, 08:10 AM
You will probably have to do it like this:
$variable = explode(',',$vbulletin->options['info_forumids']);
if (in_array($foruminfo['forumid'], $variable))
{
eval('print_output("' . fetch_template('newinfo') . '");');
} else {
eval('print_output("' . fetch_template('newthread') . '");');
}