Quote:
Originally Posted by ascroft
Hi thanks for this -
1. Previously I have used a plugin as follows:
PHP Code:
if (in_array($forumid, array(53,9999))) { header( 'Location:/listings/misc.php?do=form&fid=8' ) ; }
This linked a particular form to a particular forum and was called from newthread_form_start- presume I should be listing all of the forumids in this plugin that I want the form launched from?
2. Also, in the view form after applying the mods below against the question I just get a list of forums and can't select one? Kind of related to this, can I control what forums can be selected from (want the same as the forums that they form can be launched from in 1 above) and give them different names i.e. not show PW_Dunedin but Dunedin? Also the threadid picker which was previously using a custom question (thanks to you previously) seems to have stopped working - can't see the pick list any more for this. Other info - in the default for the formbody I had set the threadid to 'none' as the custom question then sorted that, but for the post thread I have to specify a forum - not sure if that is the issue?
Thanks.
|
1. Add them in a comma seperated list so for forumids: 53,9999,34,55,66 you would want
PHP Code:
if (in_array($forumid, array(53,9999,34,55,66)))
{
header( 'Location:/listings/misc.php?do=form&fid=8' ) ;
}
2. I missed the first line of the code off of the example. Updated original post:
https://vborg.vbsupport.ru/showpost....postcount=1135
PHP Code for the custom question, should be: (This includes the limit to show only forums: 53,9999,34,55,66)
PHP Code:
$answer = "<select name=\"$formbit[id]\" id=\"q_" . $formbit[id] . "\">";
foreach ($vbulletin->forumcache AS $forumid => $forum)
{
if (!in_array($qo['forumid'], array(53,9999,34,55,66)))
{
continue;
}
if ($qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>";