|
Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews. |
Advertisement | |
|
|
Learn how to remove ads |
|
Thread Tools | Display Modes |
#1
|
||||
|
||||
Google Module
Ok ... I've followed the Adsense Tutorial to create a Google module ...
The module works fine with the first article that is viewed. However, if you browse to a second article, the following error message is generated: "Unable to add cookies, header already sent. File: /..../gars/mods/google.php Line 11" Here is my google.php file: <?PHP if ($stage == "display") { eval('$output.="' . fetch_template('GARS_google') . '";'); } elseif($stage == "settings") { print_description_row("This module will display Google Adsense"); } ?> Here is my GARS_google template (which is just plain adsense code): <script type="text/javascript"><!-- google_ad_client = "pub-7481905953329668"; google_ad_width = 160; google_ad_height = 600; google_ad_format = "160x600_as"; google_ad_type = "text"; google_ad_channel =""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> Any suggestions? Thanks, Greg |
#2
|
||||
|
||||
Quote:
It's refering to the HTTP (not HTML) headers. What is happening is that somewhere your script is outputing data before another part of the script that is trying to modify the HTTP header. James |
#3
|
||||
|
||||
huh, I cant see for the life of me how that php can output anything however I dont use Google ads so there may be something obvious im missing.
When you say first article is OK, what do you mean? ie Other articles dont work, multiple pages dont work, etc... Does anything get output at all? |
#4
|
||||
|
||||
Quote:
But what happens is that if you open up a browser and browse to an articles forum, whatever article you view first will always work ... any other articles you try to view will generate that error message (in the image above) and be totally unviewable ... If you go to a different computer ... and browse to the same articles forum but look at a different article ... then this article will be viewable and again, any other articles will not be ... So it sure appears that we have a variable somewhere that is getting corrupted ... I'll turn it back on again on Monday so you can see <grin> ... Greg |
#5
|
||||
|
||||
Whatever the bug was ... its fixed in the new RC1 version ... uploaded the new update and the google module works fine ...
Greg |
#6
|
||||
|
||||
Whew. I was really scratching my head on that one!
|
#7
|
||||
|
||||
Quote:
I've got a test board up and running that you can log into the admin panel and play to your heart's content <grin> ... http://www.IowaBeautiful.com Google Adsense Module is working in ShowThread ... after I uploaded the new RC1 files. However, if you now try to add the module to the ForumDisplay, the same original error is generated ... Go into GARS | Modules | Default Set | Forum Display | Then at the bottom, select Google Adsense as a module to add Choose Left or Right for a section and set an order if you like ... and then click SAVE ... You will now get an error message if you try to browse any article forum ... with the exact same error message up above ... I'll PM you the login details to the admin panel ... this is a test board, so other than my wife and I entering content prior to launching, you can't harm this board <Grin> ... Greg |
#8
|
||||
|
||||
Ill get to it tonight
|
#9
|
||||
|
||||
Can you? I am getting this issue myself now.
here is a thread it happens on.. Logged in in Firefox it is ok, guest on IE gets the message. |
#10
|
||||
|
||||
I just dont get it. It doesnt even get flushed down to the browser until the page is rendered. As James mentioned, it looks like there is output getting sent before the headers. Furthermore I cant see why it would occur in forumdisplay but not showthread.
Ill see what more I can do to test . Its hard because I dont use adsense Do you know if there is some test HTML that google can provide? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Google test | Seeker | GARS Link Directory | 1 | 04-22-2009 03:36 AM |
Google Maps Module | Phrost | Geek Article and Review System | 3 | 05-18-2007 07:23 AM |
Google Ads Module request for GARS | ziG | Geek Article and Review System | 3 | 11-16-2006 08:54 AM |
WAR | GARS Link Directory | 6 | 07-03-2006 03:01 PM | |
chet | Geek Auto-Linker | 1 | 01-29-2006 07:39 PM |