PDA

View Full Version : Auto select prefix


scoutz
11-12-2012, 02:48 PM
I want to make a simple change in my forum.

If a user is browsing the threadlist with a prefixid "sold" and the user clicks on new thread I made it navigate to newthread.php?do=newthread&f=123&prefixid=sold

Once clicked on the new thread button i want the prefix with prefixid "sold" to be selected in the dropdown box.

I got this far in the vbulletin templates but not really sure what to edit.
<select name="prefixid" id="prefix" tabindex="1">
<option value="">{vb:rawphrase no_prefix_meta}</option>
{vb:raw prefix_options}
</select>

Lynne
11-12-2012, 04:34 PM
Try a plugin using hook location newthread_form_start using something like this:

if ($_GET['prefixid'] == 'sold') $newpost['prefixid']='sold';

scoutz
11-13-2012, 07:32 AM
I managed to get it working by changing line 143 in functions_prefix.php


function fetch_prefix_html($forumid, $selectedid = '', $permcheck = false)
{
...
$optionselected = ($prefixid == $_GET['prefixid'] ? ' selected="selected"' : '');
...
}