The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
![]()
Hi everyone,
My forum uses the opt-out forums modification which enables users to select certain (sub) forums from showing up on their "New posts" searches. We're upgrading to vB4 during the weekend, but the mod has not been converted for vB4 yet. I have attempted converting it myself, in order to ensure my users can continue using the functionality offered by it, but seem to be running into some trouble with getting it to show up. I am hoping someone here might be able to help me figure out where I am going wrong. Let's have a look at the plugin code first. It's been set to the hook profile_editoptions_start: Code:
function fetch_optout_forumids_array($parentid = -1, $depthmark = '') { global $optoutforumids, $vbulletin; static $indexed_forum_cache; if ($parentid == -1) { $optoutforumids = array(); $indexed_forum_cache = array(); foreach ($vbulletin->forumcache AS $forumid => $forum) { $indexed_forum_cache["$forum[parentid]"]["$forumid"] =& $vbulletin->forumcache["$forumid"]; } } if (is_array($indexed_forum_cache["$parentid"])) { foreach ($indexed_forum_cache["$parentid"] AS $forumid => $forum) { $forumperms =& $vbulletin->userinfo['forumpermissions']["$forumid"]; if ($forum['displayorder'] != 0 AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['cansearch']) AND ($forumperms & $vbulletin->bf_ugp_forumpermissions['canoptoutgnp']) AND ($forum['options'] & $vbulletin->bf_misc_forumoptions['active']) AND verify_forum_password($forum['forumid'], $forum['password'], false) ) { $vbulletin->forumcache["$forumid"]['depthmark'] = $depthmark; $optoutforumids[] = $forumid; fetch_optout_forumids_array($forumid, $depthmark . FORUM_PREPEND); } } } } fetch_optout_forumids_array(); $optoutforumbits = ''; $haveforum = false; $gnpoptoutforums = explode(',', $vbulletin->userinfo['excludeforumsgnp']); foreach ($optoutforumids AS $forumid) { $forum =& $vbulletin->forumcache["$forumid"]; if (trim($forum['link'])) { continue; } $optionvalue = $forumid; $optiontitle = "$forum[depthmark] $forum[title_clean]"; $optionclass = 'fjdpth' . (($forum['depth'] > 4) ? '4' : $forum['depth']); if (in_array($forumid, $gnpoptoutforums)) { $optionselected = 'selected="selected"'; $haveforum = true; } else { $optionselected = ''; } $templater = vB_Template::create('option'); $templater->register('optionvalue', $optionvalue); $templater->register('optiontitle', $optiontitle); $templater->register('optionclass', $optionclass); $templater->register('optionselected', $optionselected); $templater->register('show', $show); $optoutforumbits = $templater->render(); } $show['optoutgnp'] = sizeof($optoutforumids) > 0; Code:
<div class="blockrow"> <legend>{vb:phrase exclude_forums_from_gnp}</legend> <div><phrase>{vb:phrase exclude_forums_from_gnp_desc, {session.sessionurl}}</phrase></div> <label for="sel_optoutgnp">{vb:phrase exclude_forums}:</label> <select style="width: 100%" size="13" name="optoutgnp[]" id="sel_optoutgnp" multiple="multiple"> <option value="">{vb:phrase none}</option> {vb:raw optoutforumbits} </select> </div> Thanks in advance ![]() Peter |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|