Since I've been getting a steady stream of questions regarding the update to vB4, here's how you update to vB4:
The only problem with this hack in vB4 is that it doesn't appear correctly in the UserCP. This is due to vB4 using a new template creation engine (which is much, much easier to use - makes it obvious which variables are available to templates and which are not). As of right now, the templates are using variables that they don't have access to, so it doesn't work. These modifications fixes it to work with vB4:
AdminCP --> Products & Plugins --> Plugin Manager --> "SFF: User Options"
Replace this:
PHP Code:
else
{
$optionselected = '';
}
eval('$optoutforumbits .= "' . fetch_template('option') . '";');
}
$find_string = '$customfields[other]';
$add_string = fetch_template('modifyoptions_excludeforums');
$vbulletin->templatecache['modifyoptions'] = str_replace($find_string, $find_string . $add_string, $vbulletin->templatecache['modifyoptions']);
With this:
PHP Code:
else
{
$optionselected = '';
}
$templater = vB_Template::create('option');
$templater->register('optionvalue', $optionvalue);
$templater->register('optiontitle', $optiontitle);
$templater->register('optionclass', $optionclass);
$templater->register('optionselected', $optionselected);
$optoutforumbits .= $templater->render();
}
$templater = vB_Template::create('modifyoptions_excludeforums');
$templater->register('optoutforumbits', $optoutforumbits);
$template_hook['usercp_options_other'] .= $templater->render();
Make sure you save it.
Then go back into the plugin manager and edit "SFF: Cache Templates". This plugin is trying to access a variable which doesn't exist in vB4.
Change this:
PHP Code:
if (THIS_SCRIPT == 'profile')
{
$globaltemplates = array_merge($globaltemplates, array(
'modifyoptions_excludeforums',
));
}
To this:
PHP Code:
if (THIS_SCRIPT == 'profile')
{
$cache = array_merge($cache, array(
'modifyoptions_excludeforums',
));
}
Now you need to change user options to allow the user to select it. For this hack, the creator included his own template (modifyoptions_excludeforums), but that works with vB3 and needs updating for vB4.
So, go to Styles & Templates --> Style Manager --> YOUR_STYLE_HERE --> "Modify User Template Options" --> "modifyoptions_excludeforums"
Replace the entire template contents with this:
Code:
<div class="blockrow">
<legend>{vb:rawphrase exclude_forums_title}</legend>
<p class="description">{vb:rawphrase exclude_forums_desc_1} <br /> <br />{vb:rawphrase exclude_forums_desc_2}</p>
<div class="group">
<select style="width: 50%" size="13" name="excludeforumids[]" id="sel_excludeforumids" multiple="multiple">
<option value="">{vb:rawphrase exclude_none}</option>
{vb:raw optoutforumbits}
</select>
</div>
</div>
And you're done. It should work fine and dandy now.