Rotating Adsense

dabossdaboss WP V.I.P. ''The Boss''Administrator
P,

I'm referring to your post "Rewards System and Store". You mentioned that you contacted the DigitalPoints guy and he did not want to share the script for the Adsense revenue sharing code.

It's not difficult to implement. I'm sure vBulletin has a MySQL database that stores the threads and the users link to the thread. Run an SQL query on that and decide whose Adsense Id you'd use for the Ad.

For example:

1. SQL part runs and retrieve the Adsense ID of the member. I need to have a look at the Database structure of vBulletin to be able to describe this in further detail.
2. Assign the Adsense ID to a variable: E.g.
<?php $ad_client="pub-1234567890123456";?>

3. Assign the variable into the script snippet from Adsense:
<script type="text/javascript"><!--
google_ad_client = "<?php echo "$ad_client";?>";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "466677";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">;
</script>

4. You can simply test this out by replacing your Adsense ID into no. 2 above and then copy no.2 and no.3 into any webpage. Load the page into your server and test it out through a browser.

I bet I can come up with something quick and simple if I get a chance to study the vBulletin Database structure :) .

Comments

  • PythonPython Forum Leader The Royal RAM
    yes yes even i would be able to do that. But I want to do it so that you have to have a minimum number of posts before your advert is displayed.

    Also if possible id like to be able to give credits aswell to members

    The Royal Ram

  • dax00dax00 Beginner Link Clerk
    cool. does that mean members of this forum can earn money?
  • SEbasicSEbasic Advanced User VPS - Virtual Prince of the Server
    Then don't allow the option to input their adsense ID until they reach 50 posts (Or whatever).

    Literally, just don't allow people to add their ID until they have reached that limit.
    Rave it up.
  • PythonPython Forum Leader The Royal RAM
    well ive come up with a new idea....instead of your ads being displayed if you have number of posts heres how its going to work:

    With the points you earn by posting and reffering new members you will be able to purchase advert impressions. Then your advert will be displayed if you have got impressions in your account.

    The Royal Ram

  • ForgeForge Senior Member The Royal RAM
    I could probably code that for you. It would be probably really easy, if and else statements and 1 mysql_query()
    Can fat people Go skinny Dipping?
  • PythonPython Forum Leader The Royal RAM
    thanks for the offer but ive already got a code willing to do it :)

    thanks anyway

    The Royal Ram

  • ForgeForge Senior Member The Royal RAM
    no problem :)
    Can fat people Go skinny Dipping?
Sign In or Register to comment.