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.
the hack does not display the earnings.... I been waiting for an official answer from Google in wheter this hack is breaking the TOS or not...
It is not. I inquired Google about it the first day they changed to their latest TOS:
Quote:
Hello Alexander,
Thanks for your email.
To clarify, please note that you may continue displaying ads from
different publishers on your site. However, we ask that you not place ads
from two different accounts on the same web page. We appreciate your
cooperation.
Please feel free to reply to this email if you have additional questions
or concerns.
Sincerely,
thanks for sharing ...
you could reduce the queries to 0 if done right
---------
some people want functionality that is catered to them only .. which is why people hire coders ... also, 99% of vb owners do not 'stick around' vbulletin.org to find hacks ... there is simply no time for that
so, if someone pays for added funtionality and wants to share more power to them ... making the addon public will always make it a better product (in the long run)
HMM, so this shows the money you make on adsense? That is against googles TOS if I am not mistaken.
No, this hack does not show the money you make on adsense... and even if it did, sharing how much you make on adsense is not against the Google TOS anymore...