OK - thanks - progress here.
1. I have changed the plugin to launch the form from forums 53 & 65. Thanks.
2. The PHP code now shows the full forum list in the form if I don't filter - but doesn't show anything in the drop down if I restrict this. For example only including 53,65 in the array?
3. The thread prefix which is also working off a drop down doesn't show anything in the list either until I submit, then it says its missing, and then the drop down is populated. I can then select and submit - as long as the filter isn't on as per 2.
The form hook before submit presently shows:
$form['prefixid'] = $qo['prefix'];
$forumid = $form['forumid'] = $qo['forumid'];
The first row I already had for the prefix, and then added the second row now. Maybe they should be reversed?
btw the PHP in the custom question for the prefix is:
require_once(DIR . '/includes/functions_prefix.php');
$thisanswer = $q[$formbit[id]];
$prefix_options = fetch_prefix_html($form['forumid'], $thisanswer, true);
$answer = '<select name="' . $formbit[id] . '" id="q_' . $formbit[id] . '" class="bginput">';
$answer .= '<option value="">'.$vbphrase[no_prefix_meta].'</option>';
$answer .= $prefix_options;
$answer .= '</select>';
Finally, my initial test posted the thread in to the forum I launched the form (and is the default forum in the form body) from even though I selected another forum from the drop down list. I may have to do more testing re this point once a couple more of the other things are clarified.
Many thanks for your help.
Quote:
Originally Posted by bananalive
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>";
|