The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
$foruminfo variables in ad location templates?
I've added a column to the forum table and can reference the value in a conditional via $foruminfo[varname] in the forumdisplay template but what I really want to do is use it in the ad location templates. How can I get this to work? More info on what I've done is here: https://vborg.vbsupport.ru/showthread.php?t=294400
|
#2
|
||||
|
||||
I don't believe you can use conditions in the Ad Manager.
|
#3
|
|||
|
|||
I'm not using the ad manager, I'm using the ad location templates such as ad_navbar_below.
|
#4
|
|||
|
|||
I think the problem might be that $foruminfo isn't registered to the ad templates (as you mentioned in the other thread). To do that you'd use a plugin on hook parse_templates and code like:
Code:
global $foruminfo; vB_Template::preRegister('template_name', array('hideads' => $foruminfo['hideads'])); (of course you'd use the actual termplate name). Then in the template you'd check $hideads. |
#5
|
|||
|
|||
Thanks Kevin, I was sure it was a matter of preregistering something but I couldn't for the life of me figure out which var and hook. This worked like a charm, thank you!
|
#6
|
|||
|
|||
Oh, I also meant to mention this: if $foruminfo is a global variable you might be able to do it without an extra plugin, like this:
Code:
<vb:if condition="$GLOBALS['foruminfo']['hideads']"> |
#7
|
|||
|
|||
Quote:
--------------- Added [DATE]1359295508[/DATE] at [TIME]1359295508[/TIME] --------------- Works perfectly, thanks again Kevin! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|