Posted on: 09/12/05 04:49am
By: Anonymous (boo)
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.
Adsense plugin
Posted on: 09/12/05 05:01am
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.
Adsense plugin
Posted on: 09/12/05 08:10am
By: Anonymous (boo)
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...
Or is there an obvious way to do this already?
Adsense plugin
Posted on: 09/12/05 08:14am
By: Anonymous (boo)
[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.[/QUOTE]
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..?
Adsense plugin
Posted on: 09/12/05 09:26am
By: beewee
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