In vBa Links, I'm using a simple fairly plugin to generate a tab in the navbar and sub-navigation.
Here's the plugin code, which is added to the 'parse_templates' hook location:
This works fine by itself, but when I add new plugins that use $templater, it seems to nullify most of the variables that are being used in the template. For example, I can add this simple plugin to the 'global_start' hook location:
And that's enough to break the variables and keep the 'adv_links_navbar' template from my plugin from being displayed properly. I've stripped the 'adv_links_navbar' template down to some basic code just to test, but it doesn't seem to make a difference. If that additional plugin is enabled, then I lose the 'Moderation' link in the following template.
So... Anyone have any idea why things are behaving like this or what the issue is?
Here's the plugin code, which is added to the 'parse_templates' hook location:
Code:
if (VBA_SCRIPT == 'links_directory') { require_once(DIR . '/includes/vba_links_plugin_pt.php'); $vbulletin->options['selectednavtab'] = 'vba_links'; global $catid_int; } // Add navbar link if ($vbulletin->options['vba_links_addnavbar']) { $templater = vB_Template::create('adv_links_navbar'); $templater->register('catid_int', $catid_int); $templater->register('lnavbarwidth', $lnavbarwidth); $templater->register('mylinkslink', $mylinkslink); $templater->register('newlinknavbits', $newlinknavbits); $templater->register('newlinkslink', $newlinkslink); $templater->register('newpostnavbits', $newpostnavbits); $templater->register('newpostslink', $newpostslink); $templater->register('orderby', $orderby); $templater->register('poplinklinks', $poplinklinks); $templater->register('vba_options', $vba_options); $template_hook['navtab_' . $vbulletin->options['vba_links_addnavbar']] .= $templater->render(); }
Code:
$templater = vB_Template::create('anytemplate');
Code:
<li<vb:if condition="VBA_SCRIPT == 'links_directory'"> class="selected"</vb:if>> <a class="navtab" href="{vb:raw vboptions.vba_links_homeurl}/index.php{vb:raw session.sessionurl_q}">{vb:raw vboptions.vba_links_title}</a> <vb:if condition="VBA_SCRIPT == 'links_directory'"> <ul class="floatcontainer"> <li><a href="search.php{vb:raw session.sessionurl_q}" rel="nofollow">{vb:rawphrase search}</a></li> <vb:if condition="$show['modoptions']"> <li><a href="moderate.php{vb:raw session.sessionurl_q}">{vb:rawphrase moderation}</a></li> </vb:if> </ul> </vb:if> </li>
Comment