Welcome to Geeklog, Anonymous Friday, November 08 2024 @ 09:45 pm EST

Geeklog Forums

Google Adsense in the Article

Page navigation


Status: offline

flyingcats

Forum User
Newbie
Registered: 04/11/05
Posts: 9
How to add adsense in the article like in the static page or side block?
Adsense script is unavaible in article posting.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Doesn't Adsense require JavaScript? But script tags are stripped off by default. See the FAQ: Why does Geeklog remove certain HTML tags?

Also try a forum search ...

bye, Dirk
 Quote

Status: offline

flyingcats

Forum User
Newbie
Registered: 04/11/05
Posts: 9
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!
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by flyingcats: 'Script' => array('type' => 1, 'src' => 1)

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?

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
 Quote

Flyingcats

Anonymous
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">
 Quote

Status: offline

flyingcats

Forum User
Newbie
Registered: 04/11/05
Posts: 9
Update above post.

Codes below are gone away:
Text Formatted Code
<!--
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:

Text Formatted Code
<script type="text/javascript">
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
 
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
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.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by flyingcats: Update above post.

Codes below are gone away:
Text Formatted Code
<!--
 

That's a comment and comments are stripped out, too. Just leave those start / end comment tags out.

bye, Dirk
 Quote

flyingcats

Anonymous
still didn't work, help please.
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
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.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

flyingcats

Anonymous
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.


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?



 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
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 Very Happy see here
Geeklog Polish Support Team
 Quote

Status: offline

flyingcats

Forum User
Newbie
Registered: 04/11/05
Posts: 9
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 Very Happy see here


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! Wink
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
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...
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

flyingcats

Forum User
Newbie
Registered: 04/11/05
Posts: 9
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...


I will not put more than 3. 2 ads per age I think it's ok!
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
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 Wink )

geKow

p.s. why don't you give us the url as text? (without the http)
 Quote

flyingcats

Anonymous
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.

Very Happy
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
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

Status: offline

SmackDaddy

Forum User
Chatty
Registered: 05/04/05
Posts: 35
Location:Ohio
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)


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....
 Quote

Status: offline

SmackDaddy

Forum User
Chatty
Registered: 05/04/05
Posts: 35
Location:Ohio
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.

Very Happy


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

Page navigation

All times are EST. The time is now 09:45 pm.

  • 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