![]() |
Forum forumid array in plugin, for use in template conditional Hi, I spent a bit of time trying to do this myself this morning, using bits and pieces of similar threads on here, but I can't get it working. What I want to do is define an array of forumids in a plugin, and reference the output variable in a conditional. Now, I've done this for non-conditional template use with success in the past but I read that you cannot use vb:raw in this context inside a conditional. Here's the current plugin code using the global_state_check hook... Code: if (!in_array($foruminfo['forumid'], array(61,63,80,31,81,69,24,67,28,77,79,78,84))) { $show['not_sponsor'] = true; }else{ $show['not_sponsor'] = false; } Assuming that's correct, how do I reference the variable in the conditional? $not_sponsor? not_sponsor? Also, if I'm not using vb:raw in the template, do I still have to pre-register the variable in the templates? I tried it with this code in the plugin... Code: vB_Template::preRegister('ad_navbar_below',array(' not_sponsor' => $not_sponsor)); vB_Template::preRegister('ad_showthread_firstpost_ start',array('not_sponsor' => $not_sponsor)); In the end all I'm trying to do is not show ads in certain forums, or threads within those forums, without maintaining the actual array in each ad template. Any advice/help is more than welcome. :) |
الساعة الآن 09:47 PM |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.5.2 TranZ By
Almuhajir