PDA

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


amykhar
27 Dec 2007, 00:54
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
27 Dec 2007, 01:53
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
27 Dec 2007, 03:16
^ Jeeeeez

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

amykhar
27 Dec 2007, 13:23
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
27 Dec 2007, 22:43
Thank you, Amy. :)

/me clicks install

amykhar
28 Dec 2007, 13:05
Thank you, Amy. :)

* projectego clicks install

You're most welcome.

yahoooh
31 Dec 2007, 15:05
thanks

Ipuck
03 Jan 2008, 05:48
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
03 Jan 2008, 15:23
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
04 Jan 2008, 04:54
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
07 Jan 2008, 01:12
Glad you found the problem :)

snakeair
14 Feb 2008, 19:44
*Installed*

M-Tuning
15 Feb 2008, 12:53
Thanks

safakuygur
15 Feb 2008, 13:21
good thanks

amykhar
18 Feb 2008, 14:53
Glad you like it, guys :)

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

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

FlyBoy73
11 Apr 2008, 06:57
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
11 Apr 2008, 09:41
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
11 Apr 2008, 13:05
Why would it break the TOS? It simply puts ad banners on archive content pages. Or am I missing some use of it?

FlyBoy73
11 Apr 2008, 18:26
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
11 Apr 2008, 22:52
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
12 Apr 2008, 06:10
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
20 Apr 2008, 12:16
thanks, nice hack:)

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

amykhar
21 Apr 2008, 14:42
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
03 May 2008, 21:20
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=6320" 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
04 May 2008, 12:31
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
04 May 2008, 13:42
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
04 May 2008, 14:23
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
04 May 2008, 14:47
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
04 May 2008, 15:10
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
04 May 2008, 16:45
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=6320" 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
04 May 2008, 19:00
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
04 May 2008, 21:25
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
04 May 2008, 22:31
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
04 May 2008, 23:31
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
07 May 2008, 17:46
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
12 May 2008, 10:52
I installed the product but right adsense ads does not apear?
Why?

Julie
13 May 2008, 09:44
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
13 May 2008, 14:59
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
18 May 2008, 11:20
Great Hack! Thank you!

Derek_Trotter
18 Jun 2008, 17:32
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
18 Jun 2008, 19:36
i don't understand what file i'm suppose to edit for my adsense banner..plz help!

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

amykhar
20 Aug 2008, 14:37
Yes. It still works.

Markro
07 Dec 2008, 18:32
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
19 Dec 2008, 22:45
Thanks..

goldnote
23 Dec 2008, 22:12
Installed! Very nice Thank You Amy

Coume
18 Jan 2009, 19:43
Thanks Amy.

Working great :)

xlguy
26 Jan 2009, 00:38
Anyone got this working in 3.8?

realmr
26 Feb 2009, 07:54
it doesn't work on my 3.8

ZapFlash
01 Mar 2009, 23:20
i installed it in 3.8 and worked

uyduturkteam
11 Sep 2009, 01:24
Thank you friend

induslady
19 Dec 2013, 17:56
Does this work in vB 4.x ?

Thanks.