Instal Google AdSense

Instal Google AdSense

Postby exadelphe on Mon Apr 21, 2008 9:45 am

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!
exadelphe
 
Posts: 3
Joined: Thu Apr 17, 2008 9:33 am
LifeType Version: XoopsLifeType.1.0.2.

Re: Instal Google AdSense

Postby Nomad on Wed Sep 24, 2008 3:35 pm

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. :)
Blog Ireland - now with video posting
Normally most write something meaningful here so many to choose from yet most oft ignored.
Nomad
Lifetype Expert
 
Posts: 645
Joined: Sat Feb 05, 2005 8:40 pm
Location: Eire

Re: Instal Google AdSense

Postby jondaley on Tue Sep 30, 2008 8:56 am

can you upload this to bugs.lifetype so we have the code in case the link stops working? :)
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Instal Google AdSense

Postby jeremycobert on Tue Sep 30, 2008 11:49 am

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
jeremycobert
 
Posts: 4
Joined: Wed Jul 16, 2008 8:06 am
LifeType Version: 1.2.8_r6440

Re: Instal Google AdSense

Postby Nomad on Tue Sep 30, 2008 4:45 pm

: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 :) )
Blog Ireland - now with video posting
Normally most write something meaningful here so many to choose from yet most oft ignored.
Nomad
Lifetype Expert
 
Posts: 645
Joined: Sat Feb 05, 2005 8:40 pm
Location: Eire

Re: Instal Google AdSense

Postby jondaley on Fri Oct 03, 2008 11:24 am

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.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: Instal Google AdSense

Postby loglive on Sat Jan 17, 2009 4:36 pm

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}
loglive
 
Posts: 6
Joined: Sat Dec 06, 2008 11:47 pm
LifeType Version: 1.2.8

Re: Instal Google AdSense

Postby Nomad on Thu Jan 29, 2009 6:20 pm

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

:)
Blog Ireland - now with video posting
Normally most write something meaningful here so many to choose from yet most oft ignored.
Nomad
Lifetype Expert
 
Posts: 645
Joined: Sat Feb 05, 2005 8:40 pm
Location: Eire


Return to General Plugin Development

cron