The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Advertising Banner System

Geek Advertising Banner System GAB is a highly configurable banner management system for vBulletin.

Advertisement
This is an HTML example. Isn't it just wonderful?!?!
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2006, 04:24 AM
inthezone inthezone is offline
Junior Member
 
Join Date: Aug 2006
Posts: 13
Geek Article and Review System License Holder Geek Advertising Banner License Holder 
Default GAB ads in non-standard templates

For whatever reason, awhile back I decided to create my own header template that would be called from vB's default header template. While a $GAB_ads block appears when I place it in the latter, it doesn't appear if inserted into my custom template, where the bulk of the layout actually is. How can I configure this template to recognize the $GAB_ads variable?
Reply With Quote
  #2  
Old 11-30-2006, 08:58 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

If the layout is called out of scope (i.e. in a function) then in the function you will need to enter:
PHP Code:
global $GAB_ads
HTHs
Reply With Quote
  #3  
Old 11-30-2006, 11:46 PM
inthezone inthezone is offline
Junior Member
 
Join Date: Aug 2006
Posts: 13
Geek Article and Review System License Holder Geek Advertising Banner License Holder 
Default

Here is my default vB header template:

Code:
$myheader

<!-- content table -->
$spacer_open

$_phpinclude_output
$myheader is called through the following plugin (hook location: global_start):

Code:
eval('$myheader = "' . fetch_template('myheader') . '"; global $GAB_ads;');
Yet, when I place $GAB_ads[0] in the $myheader template, it still doesn't appear. Did I set up the plugin incorrectly?
Reply With Quote
  #4  
Old 12-01-2006, 09:10 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

OK... I see what you mean. In that case you dont need to put global $GAB_ads; there. You do however want to check that the GAB code in the global_start hook is executed BEFORE your code.
Reply With Quote
  #5  
Old 12-02-2006, 12:57 AM
inthezone inthezone is offline
Junior Member
 
Join Date: Aug 2006
Posts: 13
Geek Article and Review System License Holder Geek Advertising Banner License Holder 
Default

Quote:
Originally Posted by The Geek
OK... I see what you mean. In that case you dont need to put global $GAB_ads; there. You do however want to check that the GAB code in the global_start hook is executed BEFORE your code.
I've tried placing the global declaration before $myheader, after, within the eval(), outside of it, etc., but to no avail.
Reply With Quote
  #6  
Old 12-02-2006, 08:41 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Skip the global declaration, the code that starts GAB up is located in the global_start hook. You need to make sure that the GAB code is getting called BEFORE your code gets called as they are both sharing the same hook.
Reply With Quote
  #7  
Old 12-03-2006, 03:54 AM
inthezone inthezone is offline
Junior Member
 
Join Date: Aug 2006
Posts: 13
Geek Article and Review System License Holder Geek Advertising Banner License Holder 
Default

Quote:
Originally Posted by The Geek
Skip the global declaration, the code that starts GAB up is located in the global_start hook. You need to make sure that the GAB code is getting called BEFORE your code gets called as they are both sharing the same hook.
That did the trick. Thanks!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show GAB ads in Photoplog *without* using CMPS? Tigratrus Geek Advertising Banner System 3 08-29-2008 07:13 PM
What is the interest of GAB compared to free ads hacks? mushrom Geek Advertising Banner System 4 03-16-2008 09:23 AM
GAB ads in GARS template-module? pixie Geek Advertising Banner System 3 02-24-2008 02:04 PM
Using GAB on non-standard templates kidmercury Geek Advertising Banner System 6 02-12-2008 03:00 PM
VB Templates Display instead GARS Templates Michael-MI Geek Article and Review System 4 01-08-2006 05:51 PM


All times are GMT. The time now is 10:48 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.