The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
![]() Quote:
Changed and tested, but still a surprising lack of the control in my options. I just do not get it. To the best of my knowledge, this should be doing the trick. All articles I read here and all the advice I had seems to suggest this ought to work, but it does not. Very odd, indeed. I might try and start from scratch with a new plugin and work my way up from there. |
#12
|
||||
|
||||
![]()
Why don't you post the exact code you are using right now so we can try it out on our own test sites and see what is up.
|
#13
|
|||
|
|||
![]()
Hi Lynne,
Sure. Here's the code from the plugin: 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 =& $bbuserinfo['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(',', $bbuserinfo['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('mytemplate'); $templater->register('optionvalue', $optionvalue); $templater->register('optiontitle', $optiontitle); $templater->register('optionclass', $optionclass); $templater->register('optionselected', $optionselected); $templater->register('show', $show); $optoutforumbits = $templater->render(); vB_Template::preRegister('option', array('optoutforumbits' => $optoutforumbits)); } $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> |
#14
|
||||
|
||||
![]()
I'm surprised you were able to save your template when you had {session.sessionurl} instead of {vb:raw session.sessionurl}. It gave me an error until I corrected it.
This is supposed to show up on my Settings > General Settings page, right? I have it there, but it is not the "options" template, it is the "modifyoptions" template that it goes into and needs to be preregistered in. And, you didn't supply me with the contents of "mytemplate", so I can't see any output anyway. But, there is something there, it's just incomplete because you didn't provide me with the other needed info. |
#15
|
|||
|
|||
![]()
Hi Lynne,
Thank you. That seems to have done the trick. I now see something happening at least. It's not yet what I expected or needed, but it's way better than not seeing anything at all. I am assuming it did not work because even though the option template was being evaluated, that was not the right template. Thanks agian for your help. I'll see what I still need to do to get the rest working, but this is definitly an encouragement ![]() Peter |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|