Page 1 of 1

Instal Google AdSense

PostPosted: Mon Apr 21, 2008 9:45 am
by exadelphe
The plugin for Google Adsense uses the old code of Google:

google_ad_client = "";
google_ad_width = ;
google_ad_height = ;
google_ad_format = "";
google_ad_type = "";
google_ad_channel = "";


but Google has changed and the new code is:

<script type="text/javascript"><!--
google_ad_client = "";
/* 468x60, date de création 21/04/08 */
google_ad_slot = "";
google_ad_width = ;
google_ad_height = ;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


So it's impossible to use the plugin.
What can I do?

PS: sorry for my bad english!

Re: Instal Google AdSense

PostPosted: Wed Sep 24, 2008 3:35 pm
by Nomad
I've just looked over this plugin and updated it to reflect the new google method. For now I've removed the suggestion feature and search but will get around to re-implementing them (If I get time)

Only tested on my off line set up so not tested in the working environment yet.If I get time I'll see if I can get it tested fully.

http://www.blogireland.ie/test/googleadsense.zip

nb: Am also moving this to the correct forum. :)

Re: Instal Google AdSense

PostPosted: Tue Sep 30, 2008 8:56 am
by jondaley
can you upload this to bugs.lifetype so we have the code in case the link stops working? :)

Re: Instal Google AdSense

PostPosted: Tue Sep 30, 2008 11:49 am
by jeremycobert
i placed the adsense folder in the plugins directory and when i refreshed lifetype, i get these errors. i assume its a folder permission error ? im just not sure what permission to set. (latest version of lifetype on linux box).

Warning: Cannot modify header information - headers already sent by (output started at /var/www/thecoberts/blog/plugins/googleadsense/locale/locale_en_UK.php:2) in /var/www/thecoberts/blog/class/view/view.class.php on line 321

Warning: Cannot modify header information - headers already sent by (output started at /var/www/thecoberts/blog/plugins/googleadsense/locale/locale_en_UK.php:2) in /var/www/thecoberts/blog/class/view/view.class.php on line 321

Warning: Cannot modify header information - headers already sent by (output started at /var/www/thecoberts/blog/plugins/googleadsense/locale/locale_en_UK.php:2) in /var/www/thecoberts/blog/class/view/view.class.php on line 321

Warning: Cannot modify header information - headers already sent by (output started at /var/www/thecoberts/blog/plugins/googleadsense/locale/locale_en_UK.php:2) in /var/www/thecoberts/blog/class/view/view.class.php on line 321

Warning: Cannot modify header information - headers already sent by (output started at /var/www/thecoberts/blog/plugins/googleadsense/locale/locale_en_UK.php:2) in /var/www/thecoberts/blog/class/view/view.class.php on line 321

Warning: Cannot modify header information - headers already sent by (output started at /var/www/thecoberts/blog/plugins/googleadsense/locale/locale_en_UK.php:2) in /var/www/thecoberts/blog/class/view/view.class.php on line 175

Re: Instal Google AdSense

PostPosted: Tue Sep 30, 2008 4:45 pm
by Nomad
:eek: dunno - like I said I haven't tested this on a production server only on my local server and it worked fine...

I'll try getting it over to bugs in the next day or so and see if I can get more testing done...

Not sure why its doing that though... what version LT are you using? i have this working on a local copy version lifetype-1.2.8_r6440 - which is a fairly recent build....

edit: Ahh - maybe its this - open googleadsense/locale/locale_en_UK

You'll see <?php - its actually on the second line instead of at the beginning of the document - I've seen this cause that problem. Just back space that once so it is right at the start of the file...

or use the updated file below
http://www.blogireland.ie/test/googleadsense.zip

(Same link as above actually - updated the file) let me know if that fixes it - thanks :) )

Re: Instal Google AdSense

PostPosted: Fri Oct 03, 2008 11:24 am
by jondaley
You need to edit your locale file and remove the carriage return or whatever you added to that file. The <? needs to be the very first character in the file. Note that some editors hide the BOM (byte order mark) which might be causing your trouble.

Re: Instal Google AdSense

PostPosted: Sat Jan 17, 2009 4:36 pm
by loglive
Thank you for the updates, I entered a 468x15 details from an existing ad into the plugin settings, however I can't see the ad working, I tried to add the code in some .template files under the templates/admin directory to no avail.
Please, could you give me an example of what file and where can I insert the code to make it work?

Code: Select all
         {if $googleadsense && $googleadsense->isContentEnabled()}
<div align="middle"><script type="text/javascript"><!--
google_ad_client = "{$googleadsense->getClient()}";
google_ad_width = {$googleadsense->getContentWidth()};
google_ad_height = {$googleadsense->getContentHeight()};
google_ad_slot = "{$googleadsense->getContentSlot()}";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
{/if}

Re: Instal Google AdSense

PostPosted: Thu Jan 29, 2009 6:20 pm
by Nomad
sorry - just seen this

sometimes adds won't show straight away - you need to give them 24 hours - if they still don't show then double check you have filled in the details in control centre/google adsense properly

where ever you insert the code in the template is where the add will display

you can see it working here http://demo.blogireland.ie

:)