$sql = 'SELECT
country
FROM
ip2nation
WHERE
ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'")
ORDER BY
ip DESC
LIMIT 0,1';
list($country) = mysql_fetch_row(mysql_query($sql));
switch ($country) {
case 'se':
// Show Swedish ad
echo"YOUR SWEDISH AD CODE HERE";
exit;
case 'us':
// Show US ad
echo"THIS IS WHERE THE US AD CODE GOES";
exit;
default:
// Ad for the rest of the world
echo"AD CODE TO SHOW TO OTHERS";
exit;
}
I am using Adbuttons specifically for the geotargeting to display different ads to UK and US viewers. I have 4 125px ads for each country.
What I could love is a way to display some additional adverts by placing code in template files (e.g. single.php) and using the geo targeting database to do this. For example, I have one advertiser that only wants to show ads to UK, and the advert is javascript so cannot use img/url anyway. Is this possible? I am sure it must be relatively simple, and would be good to make use of the geo targeting database.
]]>Great plug-in, but I like it so much that I’d really like to use it more than once so that I can break up my ads.
Maybe in a future release you could make it so that I could create more than one instance for my site?
]]>That was what i thought but no… If you want to check it for yourself please visit http://www.desaparezca.net/blog2 with both navigators (iexplorer and firefox). There is only one ad, at the right panel, is called Ads!.
Thanks in advance.
]]>Thanks in advance for this awesome plugin. I have a strange problem, i’m using wordpress 2.8.4 and ad buttons 1.7, when i visit the website with iexplorer the ad image is visible but with firefox (3.5.3) the ad image dont show up. ¿Any idea?
]]>