vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Adsense Reveune Sharing Hack (https://vborg.vbsupport.ru/showthread.php?t=80464)

artonex 04-23-2005 10:00 PM

Adsense Reveune Sharing Hack
 
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".

Deaths 04-24-2005 11:27 AM

Is it correct that this code adds 2 queries to every page?

artonex 04-24-2005 11:35 AM

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 :)

Deaths 04-24-2005 11:44 AM

Hmm, ok.

Well, I've looked through it, and it adds 2 queries to showthread.

Lionel 04-24-2005 12:17 PM

I saw that hack at hotscripts. The guy wanted 150.00 dollars for that???

nexialys 04-24-2005 12:21 PM

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...

Guy G 04-24-2005 12:33 PM

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.

Lionel 04-24-2005 12:42 PM

That would fall into the remaining 1% :-)
Nexy's hack to insert ad randomly in thread is best.

T3MEDIA 04-24-2005 12:46 PM

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

BUT good looking out on the extra load it produces.

artonex 04-24-2005 12:49 PM

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 ?


All times are GMT. The time now is 02:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01857 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete