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 02-06-2008, 06:48 PM
kidmercury kidmercury is offline
Member
 
Join Date: Oct 2005
Posts: 34
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder 
Default Using GAB on non-standard templates

hello,

GAB is working properly when i insert into standard templates (i.e. header, footer, navbar), but is not displaying when i insert them into custom templates. (i am displaying these custom templates via GARS).

i have read the threads below regarding this problem, but cannot seem to solve it. any idea on what i need to do to have GAB run in custom templates?

http://www.thevbgeek.com/showthread.php?t=693
http://www.thevbgeek.com/showthread.php?t=2518
Reply With Quote
  #2  
Old 02-07-2008, 06:27 PM
Morgan's Avatar
Morgan Morgan is offline
Administrator
 
Join Date: Jul 2006
Posts: 2,255
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

Those would be the correct threads, and it depends on where the custom templates are being fetched. PHP has this thing called scope, and that basically means that not all variables are available in all locations. The $GAB_ads variable is available after the global_start hook, but if you want it to be accessible in functions, scope comes into play, whereby you'd need to add the following line to the start of said functions:
Code:
global $GAB_ads;
__________________
Please use the forums for support, feature requests, and similar such things. Support does not include custom code, custom template edits, or third-party modifications. PMs and emails to me should be for private information only, such as login information. If you PM or email me a support question, chances are good that I'll ignore it. Thanks.
While the work or play is on, it is a lot of fun if while you are doing one you don't constantly feel that you ought to be doing the other. -- Franklin Pierce Adams
Reply With Quote
  #3  
Old 02-11-2008, 03:28 PM
kidmercury kidmercury is offline
Member
 
Join Date: Oct 2005
Posts: 34
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder 
Default

so i need to add

global $GAB_ads;

to the code? but where? plugins or templates? or somewhere else?

thanks
Reply With Quote
  #4  
Old 02-11-2008, 05:39 PM
Morgan's Avatar
Morgan Morgan is offline
Administrator
 
Join Date: Jul 2006
Posts: 2,255
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

I cannot tell you where to add the line of code because I don't know where your custom templates are being fetched. If you search the GARS PHP files for fetch_template you will see that it appears in a number of files, plus there are possibly other places the line of code would need to go. You'd need to tell me more about the custom templates (where you set them, what they do, where they appear, possibly screenshots) for me to get a clue.
__________________
Please use the forums for support, feature requests, and similar such things. Support does not include custom code, custom template edits, or third-party modifications. PMs and emails to me should be for private information only, such as login information. If you PM or email me a support question, chances are good that I'll ignore it. Thanks.
While the work or play is on, it is a lot of fun if while you are doing one you don't constantly feel that you ought to be doing the other. -- Franklin Pierce Adams
Reply With Quote
  #5  
Old 02-11-2008, 09:18 PM
kidmercury kidmercury is offline
Member
 
Join Date: Oct 2005
Posts: 34
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder 
Default

hi morgan,

here is some more information, perhaps you can point me in the right direction:

1. i am placing the GAB variables in a custom template
2. i am then putting this custom template in a GARS module

the custom templates do not have anything but the GAB variable in them.

thanks for your patience and help thus far.
Reply With Quote
  #6  
Old 02-11-2008, 10:31 PM
Morgan's Avatar
Morgan Morgan is offline
Administrator
 
Join Date: Jul 2006
Posts: 2,255
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

Did you create a new PHP file for the module? If so, add global $GAB_ads; to the top of the file. If not, try editing the run_mod function in the gars_class_core.php file, adding the part in bold red:
Code:
                if ($stage == "display")
                {
                        $values =& $this->data['custom1'][$itemid];
                        global $vbcollapse, $show, $post, $GAB_ads;
__________________
Please use the forums for support, feature requests, and similar such things. Support does not include custom code, custom template edits, or third-party modifications. PMs and emails to me should be for private information only, such as login information. If you PM or email me a support question, chances are good that I'll ignore it. Thanks.
While the work or play is on, it is a lot of fun if while you are doing one you don't constantly feel that you ought to be doing the other. -- Franklin Pierce Adams
Reply With Quote
  #7  
Old 02-12-2008, 02:00 PM
kidmercury kidmercury is offline
Member
 
Join Date: Oct 2005
Posts: 34
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder 
Default

that worked! thanks a lot for your help morgan.
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
No more standard polls in GARS forums? pixie Geek Article and Review System 1 06-14-2007 08:56 PM
Examples of non-standard GARS in use henrikhansen Geek Article and Review System 0 01-27-2007 02:50 PM
GAB ads in non-standard templates inthezone Geek Advertising Banner System 6 12-03-2006 02:54 AM
VB Templates Display instead GARS Templates Michael-MI Geek Article and Review System 4 01-08-2006 04:51 PM
How to remove standard wrapper? carvster Geek Advertising Banner System 7 11-09-2005 06:24 AM


All times are GMT. The time now is 10:18 AM.


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