Thank you - this is all good. Nearly there.
My one remaining issue is to do with the drop down list of the forums in the custom question (now #1 with prefix #2 question and yes I do have a default forum to get the prefixes from) and filtering using an array. I am using:
$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,65)))
{
continue;
}
if ($qo['forumid']==$forumid)
{
$forum['selected'] = ' selected="selected"';
}
$answer .= "<option value=\"$forumid\"$forum[selected]>$forum[title]</option>";
}
$answer .= "</select>";
However I still don't get any values displayed - the drop down list is empty - would you mind please checking the syntax for this? (I am launching the form from forum 53 by the way)
Finally - one unrelated question - is it possible to display the prefix in the custom form output - I don't see a variable name for it and wondered.
Many thanks for your help.
Quote:
Originally Posted by bananalive
Put the forum question first, then the plugin question second.
And then change the php of the plugin to:
PHP Code:
require_once(DIR . '/includes/functions_prefix.php');
$thisanswer = $q[$formbit[id]];
$prefix_options = fetch_prefix_html($q['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>';
But the person will have to click submit or preview after selecting/changing their forum, unless you have a default forumid to fetch prefixes from, so then the code above should be
PHP Code:
require_once(DIR . '/includes/functions_prefix.php');
$thisanswer = $q[$formbit[id]];
if (!$form['forumid'])
{
$form['forumid'] = 53;
}
$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>';
|