vBulletin AdSense Revenue Sharing
Posted August 18th, 2006 @ 11:35pm by Erik J. Barzeski
There have been several "hacks" for vBulletin that allowed revenue sharing of ads shown through Google's AdSense program. First there was a hack from AlexanderT, then one from a fellow named "cinq" who has since fallen off the planet, and just today I found one from "webmastershome". There's also a $150 option from Steve Fleming, but I have several professional issues with Mr. Fleming's approach (not the least of which is his apparent lack of knowledge of the several free albeit outdated options available).
I PMed AlexanderT and was told that, when he upgraded to vBulletin 3.6.0 (he's still using 3.1.x), he'd likely update his hack and make it available to all. That still put me in a bind.
vBulletin disallows use of PHP in templates, making this whole thing a total pain. phpinclude_start and phpinclude_end seemed like valid solutions, but I wasn't sure how they'd work, and setting the variables before I even knew who had posted seemed silly.
I came up with a simple JavaScript solution I hope works. It's below.
<if condition="$post[postcount]%9 == 1">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Google Ad (Find out how <a href="http://thesandtrap.com/forum/showthread.php?t=1485" title="You too can participate" style="color: #000;">you can participate</a>, too!)</td>
</tr>
<tr>
<td class="alt1" align="center">
<div class="smallfont" align="center">
<script type="text/javascript"><!--
if('$post[field5]' == '' || $post[posts] <= 100 || $post[reputation] < 10)
{
google_ad_client = "pub-my_adsense_id_here";
google_ad_channel = "";
}
else
{
google_ad_client = "$post[field5]";
google_ad_channel = "$post[field6]";
}
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_color_border = "F6F6F6";
google_color_bg = "F6F6F6";
google_color_link = "000";
google_color_url = "666";
google_color_text = "333";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div>
</td>
</tr>
</table>
</div>
$spacer_close
</if>
Posted 11 Nov 2006 at 3:15pm #
I don't get you have done here with that code :).
What's that for?
Do you know any adsense revenue sharing script for vb 3.6?
Thanks in advance!
Gaston
Posted 11 Nov 2006 at 5:01pm #
The code does revenue sharing for vB 3.6. If you aren't sure what it does, I'm not sure what to tell you. It works.
Posted 09 Feb 2007 at 8:35pm #
Erik -
I like what you've done there. Two questions:
1) How would this work for the vb header ad?
and
2) Is this really sharing revenue because it looks like it will always credit the account of the post author?
Thanks