PDA

View Full Version : Google Adsense inside link pages as "sponsored links"


Jim_Westergren
08-03-2005, 05:14 PM
This mod will show Google Adsense under the "Featured Links" as "Sponsored Links". You can see what I mean on the site in my sig.

This mod was inspired from a thread of "seothatworks", Thank you!

In main.tpl just before "{* Links heading and sorting*}" add:

Content visible to registered users only.

Make a new file and call it googlead.tpl with these lines:

Content visible to registered users only.

Finished.

twin
08-15-2005, 12:00 AM
Man, that's perfect, thank You.

kickass
08-22-2005, 06:49 PM
This is a good mod. Make sure to add it to the wiki!

shortd81
09-15-2005, 01:21 AM
Thanks....that is very nice

Zap
10-01-2005, 06:25 PM
SWEET!!!

Thanks brother!

Chris

renfrompenn
10-12-2005, 04:32 PM
How do I get adsense to appear on the search pages as well?

yktan
10-12-2005, 04:55 PM
Content visible to registered users only.

Hi renfrompenn, to make adsense appear in the search page as well, just use the following code:
Content visible to registered users only.

instead of
Content visible to registered users only.

Bill
11-02-2005, 08:43 PM
would this mod work if i wanted to keep my featured links?

Jim_Westergren
11-02-2005, 10:29 PM
Sure.

Check the example in the site in my sig.

/ Jim

Bill
11-03-2005, 07:55 PM
Content visible to registered users only.


Thanks Jim, works great!

mike
01-08-2006, 03:07 AM
Wow, you know it's an easy mod if I can do it :D

Thanks for posting this.

thompson
01-16-2006, 07:41 PM
hi,

great mod.

i did the same as descripted in topic here. (adsense.tpl and main.tpl)

i did it also for search results.

my problem is, that sometimes the adsense were shown and sometimes not. but i cant find a error.

anyone a solution for that ?

main.tpl:
{if $category.ID gt 0 or $qu or $p}

{include file="googlead.tpl"}
{/if}

Neticus
01-16-2006, 07:59 PM
Content visible to registered users only.


I think it should be:
{if $category.ID gt 0 or $qu}

This is what is described in this post, this works for me.

Also try removing the


- Neticus

thompson
01-16-2006, 10:50 PM
does it work also on empty searchresult pages (if you search for ex. bodybuilding) ? ever tried it ?

what says the variable $p ?

Neticus
01-17-2006, 02:03 AM
Content visible to registered users only.

I have searched 'sport' on your directory and I see your problem. There is a blank space where google adsense should be.

I think I know your problem. You have google adsense code to show in category and search results. You also have google adsense code in the top right of your directory. This is causing the conflict. Sometimes google struggles to fill all boxes and will leave a box empty if it can not.

I had the same problem of blank google boxes when I tried to add another adsense block. See this discussion:

{older link removed}

Try removing the google box at the top right of your directory and I think your problem will be solved.

- Neticus

fworth
01-27-2006, 06:38 PM
Hi, i did all the requirements but still cannot get it to work--Any Help?
Lore

gariben
01-28-2006, 11:03 AM
Content visible to registered users only.

Hi Jim,

Can you repost the example in your sig? I can't seem to find out to display Google Adsense along with Featured Links.

Thanks!!!
Mike

thompson
01-28-2006, 12:30 PM
you can have a look here:

http://www.sportsuche.info/sporternaehrung/

fworth
01-29-2006, 01:17 AM
Hi, anybody is this where the code is suppose to go.. between these codes?

main.tpl

{foreach from=$feat_links item=link name=links} {include file="link.tpl" link=$link} {/foreach} {/if}

{if $category.ID gt 0 or $qu}
{include file="googlead.tpl"}
{/if}


{* Links heading and sorting*} {if ($qu or $category.ID gt 0 or $p) and count($links) gt 0}



Also, i created the googlead.tpl what type do i create it as? doc,html,shell,php

mortgages
03-15-2006, 02:53 PM
Jim in your code you have a bottom margin set at -10px

if you use this it obscures the words "Ads by Goooooogle" which as you know is very very naughty. :roll: (it should read 0px)

unless it only happened on my site of course :?

Jim_Westergren
03-15-2006, 11:22 PM
Content visible to registered users only.

Just yours I believe. Put the number so it fits.

Here is how I have it at the moment:

/Internet/

mortgages
03-16-2006, 04:27 AM
Content visible to registered users only.

:wink: Yeh, I knew that would be the case.

Strange though, I will have to look into it a bit more. I am sure it was originally fine, although I can't say I actually noticed until today.

Regards as always
GEM

KoverPL
04-06-2006, 12:57 AM
hi, how to make it so that the adsense will be displayed also on main directory page ? :)

Boby
04-06-2006, 01:16 AM
Don't put any condition ;)

Just add your adsense code.

Boby

KoverPL
04-06-2006, 01:52 AM
see:
http://www.seodir.net
the mod works fine, but i want to see the adsense also on the main http://www.seodir.net :) how to do that , :]

Boby
04-06-2006, 02:10 AM
Try this:
Content visible to registered users only.

Boby

KoverPL
04-06-2006, 10:08 AM
but where do i need to add this ? :)

Boby
04-06-2006, 12:49 PM
Content visible to registered users only.
In templates/main.tpl, put where you want it to be shown in your page.
Content visible to registered users only.

Boby

KoverPL
04-08-2006, 09:47 PM
thank you :)

Brandon Sheley
04-09-2006, 01:12 AM
thank you, works great

Neticus
05-05-2006, 07:30 PM
Aaaargh!

For some reason I can't seem to exlude one category from showing the adsense code.

This command shows google adsense on ALL categories except the homepage. How do you suggest I modify to exclude category 11 also?

{if $category.ID gt 0 or $search}
code
{if}

v3.04

Thanks

ewwharhar
05-06-2006, 07:01 PM
I got this error


Warning: Smarty error: unable to read resource: "googlead.tpl" in /home/ewwharha/public_html/libs/smarty/Smarty.class.php on line 1088

Optimit
05-06-2006, 07:53 PM
Did you upload the googlead.tpl file, or is it named incorrectly?

ewwharhar
05-06-2006, 09:16 PM
ya I uploaded it and named it googlead.tpl

Optimit
05-07-2006, 12:39 AM
hmm. Something is not right. That error is telling you that it cant find the file. Make sure the googlead.tpl is in the templates folder on your server. if you want, paste the code of your googlead.tpl here, so we can make sure there is nothing in it that should give the error.

jaffa
05-28-2006, 06:21 AM
Excellent Mod. Thank you so much.:)

Implemented it into my v3.0.5 and it works great.
{Link removed - does not appear to be working}

Cheers

lebefa
06-02-2006, 06:14 PM
I am using 3.0.5 and had problem using the code provided to show adsenses inside my search results.
So I changed for :

{if $category.ID gt 0 or $search}
{include file="googlead.tpl"}
{/if}


And now it's working much more better, displaying adsense for any queries !!:)

Steven Myers
06-02-2006, 06:24 PM
Worked well, but didn't load under as Sponsored Links though. This is under 3.05. The code shows up under the the main categories when you click one.

Thanks for the mod, would be nice to use it but my hosting company won't let me use my own adsense, I have to use theirs, but I declined ;)

anon
06-02-2006, 11:49 PM
just a side note.

i *THINK* from earlier versions the variable was called $qu for searching, and now in 3.05 it's called $search (to better help describe and make less confusing)

Rob

arrelius
06-03-2006, 03:07 PM
Really nice work Jim :D

jaffa
06-04-2006, 03:39 AM
This Mod is great and works well.
I would just like to know what Google would think about it???
I got kicked off of Adsense in the past and barely managed to get back on, now I'm to scared to implement this Mod.
Does anyone know if this can get you kicked off or is it acceptable for Google??

Two of the AdSense Program Policies
Content visible to registered users only.

gmschmitz
06-14-2006, 04:29 PM
I was thinking the same thing, I was wondering if there was a code that you can put so if you have no links on that category that the googlead won't show, that way you don't get banned for the "No Google ad may be placed on any non-content-based pages."

Optimit
06-14-2006, 04:35 PM
It depends on how severely Google looks at the term "No content". That is a broad statement, and if there is a category description on the page, then you have content. I'm not saying it is enough, but seems to me like they are actually implying that ads cannot be placed on pages solely for the purpose of putting ads there. If the page is waiting for links, I think they would understand.

BTW, Why not put a link in the category?

gmschmitz
06-14-2006, 05:02 PM
Well I started adding counties to my directory at www.us-realestateagents.com and I don't have any links in there yet, I would have to go put in 200 links I think. I was just thinking maybe something like

{if $category.ID gt 0 or $search or $Links =1}
{include file="googlead.tpl"}
{/if}

But hey I'm no programmer that's for sure;) some like this $Links =1, but that isn't it :)

Neticus
06-14-2006, 05:55 PM
Content visible to registered users only.

Hello

Try adding the codes in bold.

v3+
{if $category.ID gt 0 or $search}
{if count($links) gt 0}
{include file="googlead.tpl"}
{/if}
{/if}



V2
{if $category.ID gt 0 or $qu}
{if count($links) gt 0}
{include file="googlead.tpl"}
{/if}
{/if}


Inspiration taken from

Add Message when no links exist MOD (http://www.phplinkdirectory.com/kb/Add_Message_when_no_links_exist.html) ;)

Goodluck!

Steven Myers
07-01-2006, 03:23 PM
I just implimented this code and it worked like a charm on 3.05, very nice work and thank you!!

MyWebSearches
09-19-2006, 07:23 AM
I want to use this mod, but I would like the ads to appear in the right side of the page not in tha center.

valuebuy
04-09-2007, 09:48 AM
I greatly appreciate the mod codes I have looked at on this forum, but please when giving out mod codes besure you provide ALL the details of implemented it, because I just used a Google Ads mod code placed it in my main.tpl and it tore my website down like Mike Tyson. The only thing I could get to come up was an error message on all pages, everything disappeared. When I looked at what I did the orginal code advice did not mention this particular line of code so I thought I was supose to replace it - with the new code. I am working with the default template, so I had to go back to the the main.tpl that came with the software. Everything is working fine now, but I thought I was going to have my fourth child for a minute there.

I would greatly appreciate a good Google Ads mod code for the top of my website that is under the top bar and before the catagories. I am using the default template, I thank you all for your time and consideration. Sharing mods is a good thing, I am a novice and need complete details.:)

valuebuy
04-09-2007, 10:51 AM
Open up one of the template files. Different ones are for different parts of the page, however I'm going to assume that you know where you want it placed. All you will have to do is add {literal} before your code and {/literal} after your code. Example:


{literal}
Insert your Google Adsense code here. Just copy and paste it from Google's web site.
{/literal}

I wanted to share this information I found, because it worked on my site.

James
04-09-2007, 04:15 PM
it depends on versioning on the literal ( I have a 2.1 right now not using it)

Your far better suited using mods from the supporters forum than digging up several months old posts.

sky2k4
09-21-2007, 05:49 AM
Thank you the mod works great! , We had been manually putting inthe code, Very nice and easy!
works great!
http://host-it-planet.com/phpLD/index.php?c=27

we also added it to the detail area to... we dont want to have it to cluttered.
thanks have a geat weekend!

k.moz
01-13-2008, 09:30 AM
Thanks, this is a great mod.

I have one question though, when I implement this Google ads do not show on my main page. How could I get them to show on the main page, like index.php?

Thanks a lot.

shadav
01-13-2008, 10:14 PM
place them into your main.tpl

k.moz
01-14-2008, 03:55 AM
Content visible to registered users only.

Only problem is I have the Google Adsense on a footer and a left bar. I put Google Adsense inside the code but it shows on the link pages, not on the submit page, or anything with non-content but I want it to show on the homepage.

Basically I have Adsense in footer.tpl and leftbar.tpl surrounded by the code, which show on all the pages.

kenvin
01-14-2008, 01:17 PM
Can anybody tell me if this mod works for bidvertiser, auctionads or one of the other ad companies other than adsense?

shadav
01-14-2008, 01:51 PM
yes, all this code does is specify what pages information should show up on and what pages they shouldn't....

kenvin
01-14-2008, 05:56 PM
Content visible to registered users only.

Good Thanks...:)

k.moz
01-14-2008, 11:03 PM
Okay, so this is what I have for my code:

{if $category.ID gt 0 or $qu}
{if count($links) gt 0}

{literal}

<Google Adsense Code Here>

{/literal}

{/if}
{/if}

Does anyone see anything wrong? My website is proxydirectory.ca, so you can see what's going on.

shadav
01-15-2008, 02:50 PM
right now it's doing what you told it to do lol...if you want it to show up on every page you'll need to remove the if statements and then you'll need to add the code into your submit.tpl and any other pages you have...
or you could simply add it into your header, footer or left menu...just don't place the if statements around the code and it'll show up on every page

k.moz
01-15-2008, 09:17 PM
Content visible to registered users only.

Well the problem is I only want it to be on content pages since I don't want to get banned from Google Adsense. Is there any code that would allow me to add it to my index as well? The problem with adding the code to submit.tpl is that is will take away my whole leftside.tpl and footer.tpl. I guess I could use a code that will make it not show only on the submit page since all the categories will have links but I do not know how to do that and I cannot just add it to the submit.tpl. Is there any if statement that will do this?

Thanks.

James
01-16-2008, 06:50 PM
search "Tojo Index"

It will give you the code to use to beable to tell it what page to show on or not to show on.

shadav
01-16-2008, 10:54 PM
you'll need supporters forum access to be able to view the mod in which Dawzz is referring too....but it's well worth the $10 donation :D

k.moz
01-17-2008, 06:35 AM
Content visible to registered users only.

How much would you do this for? Much rather get someone that knows what their doing other than getting code that may not work for what I'm doing.

jochen340
01-22-2008, 05:15 PM
Hi there
I try to insert the Google Adsense code into my templates.

Question one ..... what templates do I edit ?

Question two .... Are there any restrictions from Google ?

Question three ...what would be the best format for the code ? 120x600 ?

to be used on mylinkcatalog.de

Many thanks, Joe

David
01-22-2008, 05:26 PM
You can place the google ads in places like header.tpl, top_bar.tpl and footer.tpl
You can use the standard code google gives you. You just need to wrap it in literal tags like this:

{literal}
google code here
{/literal}

jochen340
01-22-2008, 05:39 PM
Is the code you mean the User number...I mean just the number or the whole code like <script>.....all the code like size, horizontal or vertical <script>

If the whole code is in there .....what sizees do I use for example ???

That is the question :-)
Thanks a lot
Joe

I am running the 3,3 script which is great !!!!!

shadav
01-22-2008, 08:12 PM
you would use the entire code, as for if google has any restrictions you should really read their TOS and AUP

the size/style/placement of the ads are all up to you....typically you want ads to blend a bit in with the design you are using but not blend in completely so you can't see them!
The code given here is a nice one as it'll show your ads in every category...
you can also place them in any .tpl file that you wish
header.tpl, top_bar.tpl, footer.tpl or if you have a left and right menu

James
01-22-2008, 08:13 PM
google restrictions are I think what 3 adgroups max a page?? and they want the ads on pages that have actual content

shadav
01-22-2008, 08:18 PM
and no adult or gambling content