Posted on: 05/16/05 02:43pm
By: flyingcats
How to add adsense in the article like in the static page or side block?
Adsense script is unavaible in article posting.
Google Adsense in the Article
Posted on: 05/16/05 03:15pm
By: Dirk
Google Adsense in the Article
Posted on: 05/16/05 03:48pm
By: flyingcats
Hi, Dirk
When searched forum, I found a thread about same question.
http://www.geeklog.net/forum/viewtopic.php?forum=3&showtopic=49241&highlight=JavaScript
But it didn't give a clear answer.
In that thread you said that have to add a script tag, I added this,
'Script' => array('type' => 1, 'src' => 1)
Is this correct? I am not good at code.
Also you wrote" There is, however, an additional built-in filter that will render all JavaScript onXXX events (onClick, etc.) invalid. You would have to disable that filter (in lib-common.php somewhere - search for "JS") if you want to use one of those."
What should I edit in lib-common.php?
Thanks!
Google Adsense in the Article
Posted on: 05/16/05 05:02pm
By: Dirk
[QUOTE BY= flyingcats] 'Script' => array('type' => 1, 'src' => 1)[/QUOTE]
Looks okay to me. Make sure you add this to the admin_html portion only.
[QUOTE BY= flyingcats] What should I edit in lib-common.php?[/QUOTE]
Looks like the piece of code I had in mind isn't even being called in that case, so you should be fine without any further modifications.
bye, Dirk
Google Adsense in the Article
Posted on: 05/17/05 08:02am
By: Anonymous (Flyingcats)
I've added that tag to my admin_html portion, But it still didn't work.
This main part of my adsense code gone away when I saved the article.
These are saved but no use.
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
Google Adsense in the Article
Posted on: 05/17/05 08:10am
By: flyingcats
Update above post.
Codes below are gone away:
<!--
google_ad_client = "pub-0957036542827361";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="9868979094";
google_color_border = "045AA7";
google_color_bg = "FFFFFF";
google_color_link = "CC0000";
google_color_url = "0000FF";
google_color_text = "000000";
//-->
only below saved:
<script type="text/javascript">
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Google Adsense in the Article
Posted on: 05/17/05 11:07am
By: beewee
Perhaps you should put the Adsense code in the story template. You might try this:
1) Change your featuredstory.thtml template and add the Adsense code on the bottom (in a new table row and cell?)
2) Open config.php, there's an option to use the most recent story always use the featured story template. If you use this option the most recent story always has 2 Adsense ads (use the 468x60 code) on the best position you can get.
Google Adsense in the Article
Posted on: 05/17/05 05:56pm
By: Dirk
[QUOTE BY= flyingcats] Update above post.
Codes below are gone away:
<!--
[/QUOTE]
That's a comment and comments are stripped out, too. Just leave those start / end comment tags out.
bye, Dirk
Google Adsense in the Article
Posted on: 05/18/05 01:31pm
By: Anonymous (flyingcats)
still didn't work, help please.
Google Adsense in the Article
Posted on: 05/18/05 02:48pm
By: beewee
Where do you want the ads on your site? On top of the center column? In that case you can put the code in a static page and put this on top of the stories.
Google Adsense in the Article
Posted on: 05/19/05 03:23am
By: Anonymous (flyingcats)
[QUOTE BY= beewee] Where do you want the ads on your site? On top of the center column? In that case you can put the code in a static page and put this on top of the stories.[/QUOTE]
I want it to display on every article page between intro text and body text.
Yes, if I want it on homepage or other place I can easily creat a staticpage or do it in template directly.
Can't post my site URL here, when posted, I got this message, "Spam detected. Email sent to admin." What's up?
Google Adsense in the Article
Posted on: 05/19/05 04:21am
By: Robin
I've had exactly same issue reported on my site and here is the solution.
First part of code you put into header.thtml
Second part paste into an article.
And it works see
here[*2]
Google Adsense in the Article
Posted on: 05/19/05 05:21am
By: flyingcats
[QUOTE BY= Robin] I've had exactly same issue reported on my site and here is the solution.
First part of code you put into header.thtml
Second part paste into an article.
And it works see
here[*2] [/QUOTE]
Hi, Robin
That's a way, I've just tried it and it works.
But I have more than one ads on my pages. I have put a 728x90 banner in header.thtml already.
use this method, it will display same size(728x90) ads on article page. That's not good. I want to add a 300x250 to each article.
I really want to post my url here so you can take a look at my site.
But I got spam message. My site is not a spam. It's a good site. Google thinks it's good, too!
Google Adsense in the Article
Posted on: 05/19/05 05:51am
By: beewee
I want it to display on every article page between intro text and body text.
The Adsense program does NOT allow you to put more than 3 Adsense blocks on your page!
If they find out your account is deleted, and your earnings too...
Google Adsense in the Article
Posted on: 05/19/05 06:16am
By: flyingcats
[QUOTE BY= beewee]
I want it to display on every article page between intro text and body text.
The Adsense program does NOT allow you to put more than 3 Adsense blocks on your page!
If they find out your account is deleted, and your earnings too...[/QUOTE]
I will not put more than 3. 2 ads per age I think it's ok!
Google Adsense in the Article
Posted on: 05/19/05 06:15pm
By: geKow
But if you put 1 ad per article, you will have more than 3 ads per page (and I wouldn't visit a page like that a second time )
geKow
p.s. why don't you give us the url as text? (without the http)
Google Adsense in the Article
Posted on: 05/20/05 06:32pm
By: Anonymous (flyingcats)
WOW, Great! finally I got it works.
My friend made an independent adsense Javascript file for me. I only need to add the JS url like this http://mysite.com/adsense.js with simple scritp tag to the article. With this adsense JS, I can put the ads anywhere I want.
Google Adsense in the Article
Posted on: 05/20/05 10:15pm
By: geKow
I just placed the adsense code in the header.thtml, right where the middle column contend starts. So I have it on every page.
geKow
(maybe I didn't understand everything in this thread)
Google Adsense in the Article
Posted on: 05/21/05 06:31am
By: SmackDaddy
[QUOTE BY= geKow] I just placed the adsense code in the header.thtml, right where the middle column contend starts. So I have it on every page.
geKow
(maybe I didn't understand everything in this thread)[/QUOTE]
So, you simply put the Adsense code in the header.thtml file and Geeklog didn't strip the code or cause it to not show? If it's that simple, then thank you for that. Now on your site, it might look 'cleaner' if it were centered, but otherwise, I can see it works....
Google Adsense in the Article
Posted on: 05/21/05 06:34am
By: SmackDaddy
[QUOTE BY= flyingcats] WOW, Great! finally I got it works.
My friend made an independent adsense Javascript file for me. I only need to add the JS url like this http://mysite.com/adsense.js with simple scritp tag to the article. With this adsense JS, I can put the ads anywhere I want.
[/QUOTE]
So, are you saying all you did was place the Adsense code in a file, name it adsense.js, and then where did you place the code exactly to have it be between the intro text and body text of an article?
Do you have to add anything to or modify Geeklog to allow it to run javascript files? If so, what and where needs modified?
Thanks in advance....
Google Adsense in the Article
Posted on: 05/21/05 06:44am
By: geKow
[QUOTE BY= SmackDaddy] If it's that simple, then thank you for that. Now on your site, it might look 'cleaner' if it were centered, but otherwise, I can see it works....[/QUOTE]
It isn't centered, because I want it to stay at one place. When I center it, it will move on pages without right blocks.
Of course geeklog won't strip code from template files
geKow
Google Adsense in the Article
Posted on: 05/21/05 06:45am
By: SmackDaddy
Great. Thanks for the info.
Google Adsense in the Article
Posted on: 05/21/05 12:43pm
By: Anonymous (flyingcats)
[QUOTE BY= SmackDaddy]
So, are you saying all you did was place the Adsense code in a file, name it adsense.js, and then where did you place the code exactly to have it be between the intro text and body text of an article?
Do you have to add anything to or modify Geeklog to allow it to run javascript files? If so, what and where needs modified?
Thanks in advance....[/QUOTE]
Yes, place adsense code in a file, js file(
some hacking needed). name it whatever you want. Then upload this .js file to your server. When post article, you will only need to add the js file link to your article.
My link like this: (I also added a div tag to define ads position.)
<div id="google-ads"><script src="http://www.mysite.com/referer-300x250.js"></script></div>
An additional thing you need to do is to enable script tag in article posting.
It's in your config.php. add this:
'Script' => array('type' => 1, 'src' => 1)
All done.
Google Adsense in the Article
Posted on: 05/21/05 01:05pm
By: Anonymous (flyingcats)
[QUOTE BY= geKow] But if you put 1 ad per article, you will have more than 3 ads per page (and I wouldn't visit a page like that a second time )
geKow
p.s. why don't you give us the url as text? (without the http)[/QUOTE]
What we are discussing is to let ads display on Article Reading page, not homepage.
I have one in top (header.thtml, 728x90), the other in article body (300x250) and this one you can only see it when you cliclk the read more article link.