Code to alternet between adsense & YPN.

Discussion in 'Publisher Network' started by imagenesis, Jul 28, 2006.

  1. #1
    Does anyone have a code or script or any idea how to write on (I know PHP, through tutorials :) ) to alternet ads between YPN and Adsense based on the visitors location. Thanks to anyone who can points me in the write direction.
     
    imagenesis, Jul 28, 2006 IP
  2. ArcticPro

    ArcticPro Banned

    Messages:
    1,273
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Script: http://www.phpadsnew.com
    GeoIP Database: http://www.maxmind.com/download/geoip/database/

    And I think these words you meant to change, they are right not write and alternate not alternat.
     
    ArcticPro, Jul 28, 2006 IP
  3. imagenesis

    imagenesis Active Member

    Messages:
    273
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #3
    lol, funny :) and thanks!

    Are you Tauren Hari?
     
    imagenesis, Jul 28, 2006 IP
  4. ArcticPro

    ArcticPro Banned

    Messages:
    1,273
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Just trying to help, lol. :D

    I'm not sure what you meant by Tuaren Hari.
     
    ArcticPro, Jul 28, 2006 IP
  5. andy11

    andy11 Peon

    Messages:
    282
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i use the above geoip database and my own code like:

    include "path_to/geo2.php";
    if ($visitor_country_code == "US") $showme = 1;
    else $showme = 2;

    ....
    ....
    ....
    then I call showad funtion where I want the ad to show - like show_ad($showme,x); // x = (a number representing the size of the ad);
    ........
    ........

    you have many ways to call the right ad like putting all codes in this function, calling other functions or including the right file.

    to include the file that has the right ad:
    function show_ad($showme="",$ad_size=""){
    if ($showme ==1){
    if ($add_size == 1) include /pathto/yahoo_header.php;
    else if ($add_size == 2) include /pathto/yahoo_vertical.php
    else if ($add_size == x) include /pathto/yahoo_x.php;//any name or size
    }
    else {
    // do google files
    }
    }
     
    andy11, Jul 28, 2006 IP
  6. imagenesis

    imagenesis Active Member

    Messages:
    273
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Hmm, thanks. This may or may not be a pain in the ass to do with gamescript. Thanks anyway guys!
     
    imagenesis, Jul 29, 2006 IP