Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 04:58 am EDT

Geeklog Forums

Adsense plugin


boo

Anonymous
Hi, has anyone thought of making a plugin for putting adsense in stories?

My idea for such a plugin is this:

There's a separate admin page where you can put in your adsense code as block 1, block 2 etc.
Then you can simply call them in the story, like with images. Like [adsense_1].

I probably know enough php to do this, but I'd feel safer running the code of someone who knows what they're doing. Big Celebration
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
If you allow Geeklog to parse instead of filter the javascript and other tags (in config.php) you can put the adsense code in a story.

But do remember that the Adsense TOS allow you only 3 Adsense blocks per page, so you have to take care about that.

Perhaps it's easier to put the code in a static page and put this static page as a centerblock just below the featured article.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

boo

Anonymous
See, that's a problem I discovered when I was poking around in the templates: GL uses the same template for the preview of the story and the main story site. Therefore I thought of doing the [adsense_1] thing and putting it in the main text, instead of in the template.

And I the ratio of my hits is about 5/1 for individual articles over the frontpage, so the static page won't do.

What I want to do is put one right at the end of the story, just before the what's related links, and if the article is really long, I want to put one about 50% through.

I will try to make a plugin like this, but it will probably take a while since I need to brush up on my php... If anyone is interested do leave a note. I'll definitely need someone to look over the code for security problems... Smile

Or is there an obvious way to do this already?
 Quote

boo

Anonymous
Quote by beewee: If you allow Geeklog to parse instead of filter the javascript and other tags (in config.php) you can put the adsense code in a story.

But do remember that the Adsense TOS allow you only 3 Adsense blocks per page, so you have to take care about that.

Perhaps it's easier to put the code in a static page and put this static page as a centerblock just below the featured article.


Sorry, missed your first line. I tried allowing javascript for admin in the admin_html part, but I couldn't get it to work correctly, parts of the code was still disappearing.

And wouldn't it be more elegant doing an [adsense_bottom] instead of pasting in the code in each individual article..?
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Putting an Adsense block inside a story so that it looks like a normal content is not allowed bij the Adsense TOS, so why put up a lot of work for something that you might regret??

You can use Adsense in a lots of easy and correct ways:

* Sideblocks: just paste the code in a block.
* Centre column, top/bootom of the page: paste the code in an static page.
* Centre column above the stories: paste the code in header.thtml or featuredstorytext.html**.
* Centre column below the first story: paste the code in featuredstorytext.html**.
* In a fourth column: make an extra column in footer.thtml an paste the code.



** Set config.php to render each first story as a featured story
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

All times are EDT. The time is now 04:58 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content