Version: 1.00, by artonex
Developer Last Online: Jan 2007
Version: 3.0.7
Rating:
Released: 04-23-2005
Last Update: Never
Installs: 3
No support by the author.
This hack will allow you to offer Google Adsense revenue sharing to your vbulletin board users. Revenue sharing is a great way to reward your board members for their loyalty and adds a feeling of ownership in the board and it's success.
Add a User Profile Field with these settings:
Profile Field Type: Single-Line Text Box
Title: (your choice)
Description: (your choice)
Field Editable By User: Yes
Private Field: Yes
Field Searchable On Memers List: No
Show On Members List: No
(I have only specified settings for the fields you will need to change from their defaults.)
In the php_include_start template, add this code:
PHP Code:
srand();
$random_number = rand(0, 1);
$ga_adsenseid = 'ENTER_YOUR_ADSENSE_ID_HERE';
if ($random_number == 1)
{
if (THIS_SCRIPT == 'showthread')
{
if (!empty($_REQUEST['t']))
{
$ga_threadid = $_REQUEST['t'];
}
else
{
$ga_threadid = $_REQUEST['threadid'];
}
$ga_thread = $DB_site->query_first("
SELECT postuserid
FROM ".TABLE_PREFIX."thread
WHERE threadid = $ga_threadid ");
$ga_user = $DB_site->query_first("
SELECT field7 AS adsenseid
FROM userfield
WHERE userid = $ga_thread[postuserid] ");
}
elseif (THIS_SCRIPT == 'showpost')
{
if (!empty($_REQUEST['p']))
{
$ga_postid = $_REQUEST['p'];
}
else
{
$ga_postid = $_REQUEST['postid'];
}
$ga_post = $DB_site->query_first("
SELECT userid
FROM ".TABLE_PREFIX."thread
WHERE postid = $ga_postid ");
$ga_user = $DB_site->query_first("
SELECT field7 AS adsenseid
FROM userfield
WHERE userid = $ga_post[userid] ");
}
if (!empty($ga_user['adsenseid']))
{
$ga_adsensecode = $gauser['adsenseid'];
}
}
Then, where ever you have your AdSense display code, find the spot where you specify your AdSense ID and replace it with $ga_adsenseid . Also make sure in the above code that you enter YOUR AdSense ID in the spot above where it says "ENTER_YOUR_ADSENSE_ID_HERE".
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Thanks for Sharing TheWebJunkie.
Is there an additional section in the user cp so they can view their ads and manage when they want them displayed?.
ALso is there any kind of control over users who register and never post, like points for posting or something.?
Using his hack and mine together would be very good
you can build a merge if you like... as you're not a coder, just ask someone to do it... but refuse to pay for such a hack next time... most coders here will do it for free if they see a good advertising power in it!
Using adsense makes your forums look like crap and lines the pockets of Googles shareholders more than it will ever benifit your members. In other words you're being exploited but... Proceed, Carry on, Pretend I never said nuthin...
@nexialis... this hack can be a good one for webmaster forums
@geographic2... if you know how to place them adsense can be a great tool to maintain your site... you can always have them display for guests only... and like I said, you go to know how and where to place them... google adsense is the best thing that could happen to many webmasters
@thewebjunkie... thanks for sharing this with the community... is greatly appreciated specially since you had to pay for it... I dont know if I would use it, with google TOS I'm still not really sure if they agree with this type of hacks..... anyways, thank you
@thewebjunkie... thanks for sharing this with the community... is greatly appreciated specially since you had to pay for it... I dont know if I would use it, with google TOS I'm still not really sure if they agree with this type of hacks..... anyways, thank you
Google do allow this hack, a few ppl emailed google about it, there email reply can be found on http://forums.digitalpoint.com