View Full Version : GAB and GARS ???
greg watson
12-08-2005, 03:07 AM
Installed GAB tonight ...
Looks like it will do a lot ...
Problem #1:
I can get GAB images to display if they are in the standard vB showthread, however, nothing if I am using GARS ...
Does GARS use some scripts that we need to add to GAB? In order for GAB to believe that they are legitimate scripts to publish in?
I can get GAB to publish in a header template ... but I can not get GAB to publish in a GARS_xxxxx template ...
For example, I have created a GARS_gab template and included $GAB_ads[1] in it ... I can not get it to display ... however, if I put $GAB_ads[1] in the header template it will display in what I consider to be showthread mode
Problem #2
If I add GAB as a module in the left column of ForumDisplay I get:
Unable to add cookies, header already sent.
File: /home/bhm1264/public_html/iowabeautiful/geek/gars/mods/gabads.php
Line: 10
Problem #2 sound awfully familiar <grin> ...
Ideas?
Thanks,
Greg
The Geek
12-08-2005, 05:34 PM
Hey Greg,
#1 shouldnt be an issue if you are placing $GAB_ads[0] in a template shared by GARS (ie your header or navbar). If however its put in forumdisplay, GARS swpas that template out at run time so you would have to put $GAB_ads[0] in that template too.
The script (showthread) is what GAB uses to determine if it should show an ad or not - and that doesnt change.
#2 sounds like you have created a GARS module to show GAB ads in which was going to be a suggestion of mine :)
However it doesnt look like its set up right? It looks like its spitting out HTML or javascript BEFORE the page gets flushed. Can you post your code for it?
Thanks!
greg watson
12-08-2005, 07:40 PM
Hey Greg,
#1 shouldnt be an issue if you are placing $GAB_ads[0] in a template shared by GARS (ie your header or navbar). If however its put in forumdisplay, GARS swpas that template out at run time so you would have to put $GAB_ads[0] in that template too.
The script (showthread) is what GAB uses to determine if it should show an ad or not - and that doesnt change.
$GAB_ads[0] is installed in the GARS_gab template ...
See the gab2.jpg attachment below.
The gab1.jpg attachment shows what is displayed in a GARS thread ...
Temporarily, I have also tried to put both $GAB_ads[0] and $GAB_ads[1] in this template with no luck.
#2 sounds like you have created a GARS module to show GAB ads in which was going to be a suggestion of mine :)
The short term goal is to be able to display 3 125x125 banners in the left column to the left of a GARS article ... got to get the little things to work first before we try to figure out the more complicated things.
The long term goal will be to display 3 forums specific ads in this column which will probably require a little extra code ...
However it doesnt look like its set up right? It looks like its spitting out HTML or javascript BEFORE the page gets flushed. Can you post your code for it?
Thanks!
See attachment gab2.jpg below ...
Thanks,
Greg
The Geek
12-08-2005, 10:18 PM
What about your module code?
You may want to place:
global $GAB_ads;
in it.
greg watson
12-08-2005, 10:30 PM
What about your module code?
You may want to place:
global $GAB_ads;
in it.
<grin> ... ok ... time for a terminology lesson for me <grin> ... what do you mean by module code in context of "global $GAB_ads;"?
When I read in GAB instructions to put $GAB_ads[0] ... it is incredibly incredibly vauge ... so most people like myself are flying out here by the seat of our pants absolutely clueless <grin> ... so we give things our very best shot <grin> ...
If I stick $GAB_ads[0] in a navbar template, it appears
But it does not appear if I stick in it a GARS_gab template ...
Personally ... I don't perceive a difference between the two templates.
Now if by "Module code" you mean did I activate the GARS_gab module by adding it to a GARS module like the Deault module ... then yes, the GARS_gab module is added to it <grin> ... that is why if you look at the GAB1.jpg attachement above ... you see that the GARS_gab template is being displayed (specifically, you can see the words "Coming soon" being displayed)... and then if you look at the GAB2.jpg attachment above ... you can see that the GARS_gab template has the words coming soon in that template (which I believe, its this template installed in the module that creates the left hand column) ...
Now what "global $GAB_ads;" means ... I have no clue ... I can't find any mention of what this might mean nor where it might be inserted ... <grin> ... I'm flying by the seat of my pants here <grin> ... not complaining <grin> ... just trying "get a clue" <grin> ...
So I think I am totally missing whatever you mean by "Module Code" in context of the "global $GAB_ads;" variable <grin> ...
Thanks,
Greg
The Geek
12-08-2005, 10:41 PM
hehe,
Ill see if I can post module code tomorrow. What Im specifically talking about is the gabads.php module file.
there needs to be a line in there that looks like:
global $GAB_ads;
Technically speaking, $GAB_ads is a variable that is 'out of scope' - meaning that the module cant read the value for it. Putting the global line in there opens it up so to speak :)
HTHs
greg watson
12-08-2005, 10:49 PM
hehe,
Ill see if I can post module code tomorrow. What Im specifically talking about is the gabads.php module file.
there needs to be a line in there that looks like:
global $GAB_ads;
Technically speaking, $GAB_ads is a variable that is 'out of scope' - meaning that the module cant read the value for it. Putting the global line in there opens it up so to speak :)
HTHs
Well <grin> ... I looked at my "Go" "Bads" file <grin> ...
It looked like this:
<?PHP
if ($stage == "display")
{
eval('$output.="' . fetch_template('GARS_gab') . '";');
}
elseif($stage == "settings")
{
print_description_row("This module will display GAB ads");
}
?>
If you tell me where to insert this <grin> ... I will <grin> ...
Thanks,
Greg
The Geek
12-09-2005, 12:27 PM
Make it this:
<?PHP
if ($stage == "display")
{
global $GAB_ads;
eval('$output.="' . fetch_template('GARS_gab') . '";');
}
elseif($stage == "settings")
{
print_description_row("This module will display GAB ads");
}
?>
HTHs
greg watson
12-09-2005, 11:22 PM
Ok ... the new gobads code fixed problem #1 ...
However, for problem #2 ... I am still getting the following error message if I try to add the GARS_gab template to the forum display module ...
Unable to add cookies, header already sent.
File: /home/bhm1264/public_html/iowabeautiful/geek/gars/mods/gabads.php
Line: 14
You looked at a similar problem once before ... in this thread http://www.thevbgeek.com/showthread.php?t=432 , you logged in and uploaded a new file ... but in the thread, you never told me what the fix was ...
I suspect whatever your fix was back then for the GARS is probably coming into play here for the GAB ...
Thanks,
Greg
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.