PDA

View Full Version : Miscellaneous Hacks - Google Adsense Banners (or others) in Your Archive


amykhar
12-26-2007, 10:00 PM
This is a mod that has been working since 3.5.x. It still works in 3.7 beta 3 from my testing. I am reposting it to make it easier for people to find.

It is tested on my vbulletin 3.7 test forum and can be seen at http://eaforums.com/forums/archive/index.php/


Essentially, this product allows you to have adsense (or other) banners in your forum archives.

To install:
Import the product. Edit the plugin code to substitute your adsense code.

Note: I have marked this mod as using external content because just about any ad banner system you use pulls in content from another site, unless you host the banner images locally.

Unfortunately, I work full time now and am not actively supporting my mods. Thank you for understanding.

youradhere4222
12-27-2007, 12:53 AM
If the example you provided, EA Forums (http://www.eaforums.com/forums), is owned by you, I'd advise you to change the font color of your vBulletin and vBSEO copyright information. It's a violation of the rules to make them unreadable.

SwollenCranium
12-27-2007, 02:16 AM
^ Jeeeeez

Hornstar
12-27-2007, 10:10 AM
Yeah, I think I still have this installed on my site from 3.5.x ^^

amykhar
12-27-2007, 12:23 PM
If the example you provided, EA Forums (http://www.eaforums.com/forums), is owned by you, I'd advise you to change the font color of your vBulletin and vBSEO copyright information. It's a violation of the rules to make them unreadable.

Thank you for noticing that :) I put somebody else's theme on for the holidays and never checked.

projectego
12-27-2007, 09:43 PM
Thank you, Amy. :)

* projectego clicks install

amykhar
12-28-2007, 12:05 PM
Thank you, Amy. :)

* projectego clicks install

You're most welcome.

yahoooh
12-31-2007, 02:05 PM
thanks

Ipuck
01-03-2008, 04:48 AM
Thank you Amy!!

One question:

I have two sites, one with vBSEO and one without, for some reason in the one with vBSEO works great but in the one without only the bottom ad shows. I tried everything, uninstall-install twice, check all my setting, copied the same codes from one site to the other and nothing works.

Do you have an idea what is the problem?

amykhar
01-03-2008, 02:23 PM
Can you send me the url of the one without? I can inspect the HTML. You might be missing a quote or something in that one. I've tested it on a site with and without with no differences.

Amy

Ipuck
01-04-2008, 03:54 AM
Can you send me the url of the one without? I can inspect the HTML. You might be missing a quote or something in that one. I've tested it on a site with and without with no differences.

Amy

Thanks Amy!

I found the problem, I forgot that I'm using the Zoints SEO mod in the forum that is not showing the ads, and Zoints has their own plug in to add ads in the archives. I uninstall yours :o and I'm using the Zoints plug in. Thanks

BTW I never thought the amount of archives pages that are viewed, I thought those pages never showed in the SERPS. I was missing revenue big time.

Thanks for the mod.

amykhar
01-07-2008, 12:12 AM
Glad you found the problem :)

snakeair
02-14-2008, 06:44 PM
*Installed*

M-Tuning
02-15-2008, 11:53 AM
Thanks

safakuygur
02-15-2008, 12:21 PM
good thanks

amykhar
02-18-2008, 01:53 PM
Glad you like it, guys :)

Black Tiger
02-21-2008, 03:54 PM
Looks interesting. Can it be installed without conflicting with the vbSEO Google/Yahoo Sitemap generator mod and without violating google adsense rules?

crkgb
04-10-2008, 12:59 AM
Hmm. And what is the way to uninstall it? Can't find a single link in neither products nor plugins

FlyBoy73
04-11-2008, 05:57 AM
Hi Amy,

Thanks for a great hack. I installed it a few days back but have not changed the code up yet as thanks for your work.

It's appreciated!

GrAveTzT
04-11-2008, 08:41 AM
Hmm. And what is the way to uninstall it? Can't find a single link in neither products nor plugins

You just go to "Manage products" then hit the drop down tab where it says "edit" for the "Archive Adsense" Product. It will say "uninstall".



I realize that there is no support for this but I might as well ask anyway.

Can anyone confirm that this does not break the TOS of Google Adsense?

amykhar
04-11-2008, 12:05 PM
Why would it break the TOS? It simply puts ad banners on archive content pages. Or am I missing some use of it?

FlyBoy73
04-11-2008, 05:26 PM
You just go to "Manage products" then hit the drop down tab where it says "edit" for the "Archive Adsense" Product. It will say "uninstall".



I realize that there is no support for this but I might as well ask anyway.

Can anyone confirm that this does not break the TOS of Google Adsense?

It does not break any Adsense TOS.

crkgb
04-11-2008, 09:52 PM
You just go to "Manage products" then hit the drop down tab where it says "edit" for the "Archive Adsense" Product. It will say "uninstall".

lol thank you so much stupid me could not find the name of the mod

GrAveTzT
04-12-2008, 05:10 AM
I guess it shouldn't break the TOS.

Its just google demands you to have content on the site and I figured that the archive list may not be enough.

almannai
04-20-2008, 11:16 AM
thanks, nice hack:)

fukdawrld
04-21-2008, 03:05 AM
i cant seem to get it to show anywhere please help

amykhar
04-21-2008, 01:42 PM
To the above poster (sorry, refuse to type that name :D) I can't check your installation because your homepage isn't linked. However, when you first start using adsense banners on new pages, it often takes some time for the banners to show up. This is because it takes google a bit of time to serve the ads to the page. If they are still not there after a day, pm me the link to your archive and I'll see what I can see.

Phornixx
05-03-2008, 08:20 PM
I dont seem to get this working, I dont use Adsense, I use AdutAdWorld ads, my code is as follows:

Header

$output.='
<div align="center">

<!-- begin Ad World Media for channel: Amateur , publisher: XXX http://XXXXXXX.com , Ad Dimension: Super Banner - 728 x 90 -->
<script language="javascript">
document.write('<iframe src="http://newt1.adultadworld.com/jsc/z5/ff2.html?n=607;c=2437;s=6320;d=14;w=728;h=90;p=632 0" frameborder=0 marginheight=0 marginwidth=0 scrolling="no" allowTransparency="true" width=728 height=90></iframe>');
</script>
<!-- end Ad World Media for channel: Amateur , publisher: XXX http://XXXXXXXX.com , Ad Dimension: Super Banner - 728 x 90 -->

</div>
</td>
</tr>
</table>
';

The error in the archive page is this:

Parse error: syntax error, unexpected T_STRING in /usr/www/XXXX/www.XXXXXX.com/archive/index.php(254) : eval()'d code on line 6

And the same for the footer code, any help?


Thanks in advance...

Julie
05-04-2008, 11:31 AM
Thanks :)

Edit: I'm having some problems with some conditionals. The ads show up alright, but the user groups I've specified, shouldn't see the ads. Here's part of my conditional code:

<if condition="is_member_of($bbuserinfo, 21, 26, 6, 1)"><p>No ads</p><else /><div align="center">
<p>Ads code</p>
</div>
</if>


But what it is doing, is (if using the code above) print out both "No ads" and "Ads code". What do I have to write in the plugin to get it to NOT display ads for members of user groups X, Y, Z, but show the ads for members of user groups A, B, C?

I also tried writing a PHP conditional

if (condition) {
}
else {
}

But that didn't work either :/

Thanks in advance :)

veenuisthebest
05-04-2008, 12:42 PM
I believe your conditional is wrong..

Use this instead

<if condition="is_member_of($vbulletin->userinfo, 21, 26, 6, 1)"><p>No ads</p><else /><div align="center">
<p>Ads code</p>
</div>
</if>

Julie
05-04-2008, 01:23 PM
I believe your conditional is wrong..

Use this instead

<if condition="is_member_of($vbulletin->userinfo, 21, 26, 6, 1)"><p>No ads</p><else /><div align="center">
<p>Ads code</p>
</div>
</if>

Thanks for your help, but that didn't do the trick either :S

veenuisthebest
05-04-2008, 01:47 PM
it shouldn't be !!

Its definitely something to do with conditional.. also try this:-

<if condition="is_member_of($vbulletin->userinfo, array(1, 2, 3))">

anyways Visit here (http://forum.vbulletinsetup.com/f28/vbulletin-template-conditionals-list-2185.html) for a nice Template Conditionals list.. it should solve your problem !!

Julie
05-04-2008, 02:10 PM
it shouldn't be !!

Its definitely something to do with conditional.. also try this:-

<if condition="is_member_of($vbulletin->userinfo, array(1, 2, 3))">anyways Visit here (http://forum.vbulletinsetup.com/f28/vbulletin-template-conditionals-list-2185.html) for a nice Template Conditionals list.. it should solve your problem !!

Nope, that didn't work either :( Maybe it has something to do with the <phpcode> tag in the xml file?

Oh well... It wasn't meant to be I guess :D Hehe...

Thanks for the link by the way, will definitely take a look at it! :)

Phornixx
05-04-2008, 03:45 PM
I dont seem to get this working, I dont use Adsense, I use AdutAdWorld ads, my code is as follows:

Header

$output.='
<div align="center">

<!-- begin Ad World Media for channel: Amateur , publisher: XXX http://XXXXXXX.com , Ad Dimension: Super Banner - 728 x 90 -->
<script language="javascript">
document.write('<iframe src="http://newt1.adultadworld.com/jsc/z5/ff2.html?n=607;c=2437;s=6320;d=14;w=728;h=90;p=632 0" frameborder=0 marginheight=0 marginwidth=0 scrolling="no" allowTransparency="true" width=728 height=90></iframe>');
</script>
<!-- end Ad World Media for channel: Amateur , publisher: XXX http://XXXXXXXX.com , Ad Dimension: Super Banner - 728 x 90 -->

</div>
</td>
</tr>
</table>
';

The error in the archive page is this:

Parse error: syntax error, unexpected T_STRING in /usr/www/XXXX/www.XXXXXX.com/archive/index.php(254) : eval()'d code on line 6

And the same for the footer code, any help?


Thanks in advance...

And what about me? Any help? :(

Julie
05-04-2008, 06:00 PM
And what about me? Any help? :(

It might have something to do with the single quotes you've used in the document.write('') statement.

$output.='

^ is started and ended with a single quote ('), and I don't know for sure, but maybe the single quotes in the document.write statement causes the $output to be ended earlier than it should...

You can try changing the single quotes to double quotes;

document.write("Hello World!")

I have no idea if that'll do the trick though :/

Phornixx
05-04-2008, 08:25 PM
It might have something to do with the single quotes you've used in the document.write('') statement.

$output.='

^ is started and ended with a single quote ('), and I don't know for sure, but maybe the single quotes in the document.write statement causes the $output to be ended earlier than it should...

You can try changing the single quotes to double quotes;

document.write("Hello World!")

I have no idea if that'll do the trick though :/

Nice try, the error is gone now but my ads dont show up because I changed the Code. Any other way I could modify the outside Ad code? Thanks!

Julie
05-04-2008, 09:31 PM
Nice try, the error is gone now but my ads dont show up because I changed the Code. Any other way I could modify the outside Ad code? Thanks!

Hm, then try changing the $output.=' single quote to double quote. Don't forget the last one on the end, after your own code finishes...

Phornixx
05-04-2008, 10:31 PM
Hm, then try changing the $output.=' single quote to double quote. Don't forget the last one on the end, after your own code finishes...

That was the first thig I tried but no success, I get the same arror again and again. How can I change the $output.=' ??

Julie
05-07-2008, 04:46 PM
That was the first thig I tried but no success, I get the same arror again and again. How can I change the $output.=' ??

I have no idea :/ I don't know a lot about vbulletin/php programming. Sorry!

Derek_Trotter
05-12-2008, 09:52 AM
I installed the product but right adsense ads does not apear?
Why?

Julie
05-13-2008, 08:44 AM
I installed the product but right adsense ads does not apear?
Why?

Did you remember to change the Adsense code in the XML file? You have to change the code provided with your own code BEFORE uploading.

amykhar
05-13-2008, 01:59 PM
Julie, you can change the code after you upload too. :)

Derek, sometimes it takes a while before Google starts serving your ads on a new page. Without a link to your site, I can't look to see if you have a problem or if it's a normal Google delay.

netzrate
05-18-2008, 10:20 AM
Great Hack! Thank you!

Derek_Trotter
06-18-2008, 04:32 PM
Everything works just fine:)
Can you tell me @amykhar how can you make regular skin for your archive(not white one like everybody have)?
This is sample page that I have visit on your forum:
http://www.eaforums.com/forums/articles/37815-review-writing-your-audience.html

Thanks!

shaqoneal
06-18-2008, 06:36 PM
i don't understand what file i'm suppose to edit for my adsense banner..plz help!

nwingate
08-13-2008, 02:15 PM
Does this still work? Just wondering since it was made for a Beta

amykhar
08-20-2008, 01:37 PM
Yes. It still works.

Markro
12-07-2008, 05:32 PM
Thanks would've been nice if you could've made it easy to change the google adsense client id, rather than having to hunt them down.

momo2
12-19-2008, 09:45 PM
Thanks..

goldnote
12-23-2008, 09:12 PM
Installed! Very nice Thank You Amy

Coume
01-18-2009, 06:43 PM
Thanks Amy.

Working great :)

xlguy
01-25-2009, 11:38 PM
Anyone got this working in 3.8?

realmr
02-26-2009, 06:54 AM
it doesn't work on my 3.8

ZapFlash
03-01-2009, 10:20 PM
i installed it in 3.8 and worked

uyduturkteam
09-11-2009, 12:24 AM
Thank you friend

induslady
12-19-2013, 05:56 PM
Does this work in vB 4.x ?

Thanks.