Adsense Revenue Sharing hack

Discussion in 'vBulletin' started by TheWebJunkie, Mar 31, 2005.

  1. #1
    Hope you all like this hack for vbulletin :D

    My paypal is if you would like to make a small donation :)

    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:
    
    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'];
    	}
    }
    
    PHP:
    Then, whereever 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".
     
    TheWebJunkie, Mar 31, 2005 IP
  2. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why would we donate to you for cut and pasted code that someone else developed??
     
    yfs1, Mar 31, 2005 IP
  3. TheWebJunkie

    TheWebJunkie Banned

    Messages:
    630
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I paid for this hack to be created along time ago, before all the other boards started to get it!

    So dont you accuse me of ripping code mate!
     
    TheWebJunkie, Mar 31, 2005 IP
  4. Homer

    Homer Spirit Walker

    Messages:
    2,396
    Likes Received:
    150
    Best Answers:
    0
    Trophy Points:
    0
    #4
    How could someone bearing a badge be stealling :D
     
    Homer, Mar 31, 2005 IP
  5. schlottke

    schlottke Peon

    Messages:
    2,185
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #5
    DP wasn't the first forum to develop that code, so TWJ wouldnt be doing anything wrong in my opinion.
     
    schlottke, Mar 31, 2005 IP
  6. TheWebJunkie

    TheWebJunkie Banned

    Messages:
    630
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I just thought id share the hack here, i thought some people might be greatful!

    Guess i was wrong :(
     
    TheWebJunkie, Mar 31, 2005 IP
  7. anthonycea

    anthonycea Banned

    Messages:
    13,378
    Likes Received:
    342
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Which one was the first Snitch Baby :confused:
     
    anthonycea, Mar 31, 2005 IP
  8. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #8
    My original post had nothing to do with DP but I will just leave it at that and walk away from this post.

    Enjoy
     
    yfs1, Mar 31, 2005 IP
  9. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #9
    If we are going to be code police, let's talk non RFC complient RSS readers. :eek: :confused:

    Holy can of worms Batman!
     
    noppid, Mar 31, 2005 IP
  10. TheWebJunkie

    TheWebJunkie Banned

    Messages:
    630
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Tell me what your getting at yfs1!
     
    TheWebJunkie, Mar 31, 2005 IP
  11. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Like I said, I'm not getting at anything. I just clarified that DP never had anything to do with my posting. Thats all
     
    yfs1, Mar 31, 2005 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #12
    Really? Who was?
     
    digitalpoint, Mar 31, 2005 IP
  13. anthonycea

    anthonycea Banned

    Messages:
    13,378
    Likes Received:
    342
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Yeah, that is what I want to know :confused:
     
    anthonycea, Mar 31, 2005 IP
  14. schlottke

    schlottke Peon

    Messages:
    2,185
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I'd seen it on vB forums back as far as a 2.0x release (*in a less advanced way than you've done it)- I'll check when I get on my laptop for the URL if you really need to know... lol.
     
    schlottke, Mar 31, 2005 IP
  15. anthonycea

    anthonycea Banned

    Messages:
    13,378
    Likes Received:
    342
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Sure you did............. :p :p :p :p
     
    anthonycea, Mar 31, 2005 IP
  16. akeeldin

    akeeldin Guest

    Messages:
    44
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Seems a 'chicken and egg' situation. Difficult to pin who came up with what first.

    Heck, SCO even claims to have 'invented' Linux. :eek:
     
    akeeldin, Apr 22, 2005 IP
  17. onestop

    onestop Well-Known Member

    Messages:
    534
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    138
    #17
    Actually I thought about linux before SCO :)
     
    onestop, Apr 22, 2005 IP
  18. Dio

    Dio Well-Known Member

    Messages:
    725
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    120
    #18
    I used to get up ten hours before I went to bed, just to think about stuff that wouldn't be thought about for another fifteen years...

    And you tell that to the young people of today - and they won't believe you... :D
     
    Dio, Apr 22, 2005 IP
  19. EmotionallyDead

    EmotionallyDead Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    So does this revenue sharing modification work as promised?
     
    EmotionallyDead, May 21, 2008 IP
  20. Tech-Coder

    Tech-Coder Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Yes it does but this post is really out dated there maybe better ways of going about it now :).


    Tech,
     
    Tech-Coder, May 21, 2008 IP