Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Adsense Reveune Sharing Hack Details »»
Adsense Reveune Sharing Hack
Version: 1.00, by artonex artonex is offline
Developer Last Online: Jan 2007 Show Printable Version Email this Page

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(01);
$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.

Comments
  #2  
Old 04-24-2005, 11:27 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it correct that this code adds 2 queries to every page?
Reply With Quote
  #3  
Old 04-24-2005, 11:35 AM
artonex artonex is offline
 
Join Date: Mar 2005
Location: UK
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Im not sure, i paid someone to code this hack for me. I have seen a few ppl wanted it so i decided to share it with all
Reply With Quote
  #4  
Old 04-24-2005, 11:44 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, ok.

Well, I've looked through it, and it adds 2 queries to showthread.
Reply With Quote
  #5  
Old 04-24-2005, 12:17 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I saw that hack at hotscripts. The guy wanted 150.00 dollars for that???
Reply With Quote
  #6  
Old 04-24-2005, 12:21 PM
nexialys
Guest
 
Posts: n/a
Default

point with such a hack is that 99% of boards users don't even know about AdSense, so i don't see why you'd be asked to pay for such a hack...

and adding the field in the users table would speed up the treatment and cut a query...
Reply With Quote
  #7  
Old 04-24-2005, 12:33 PM
Guy G Guy G is offline
 
Join Date: Nov 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nexialys
point with such a hack is that 99% of boards users don't even know about AdSense, so i don't see why you'd be asked to pay for such a hack...

and adding the field in the users table would speed up the treatment and cut a query...
Yes but what if your board related to webhosting and such? like DigitalPoint... That hack would work great in there.
Reply With Quote
  #8  
Old 04-24-2005, 12:42 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would fall into the remaining 1% :-)
Nexy's hack to insert ad randomly in thread is best.
Reply With Quote
  #9  
Old 04-24-2005, 12:46 PM
T3MEDIA T3MEDIA is offline
 
Join Date: Dec 2004
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The guy is offerning to share... lets not chop him down.

BUT good looking out on the extra load it produces.
Reply With Quote
  #10  
Old 04-24-2005, 12:49 PM
artonex artonex is offline
 
Join Date: Mar 2005
Location: UK
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lionel
That would fall into the remaining 1% :-)
Nexy's hack to insert ad randomly in thread is best.
Where can i find that hack ?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:41 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04258 seconds
  • Memory Usage 2,299KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete