View Single Post
Old 12-31-2013, 05:36 AM  
Constantine
Confirmed User
 
Constantine's Avatar
 
Industry Role:
Join Date: Jan 2008
Posts: 156
Quote:
Originally Posted by Oracle Porn View Post
this works, but how do I show nothing for some countries?
No problem, try this one:

PHP Code:
<?php

    $banner
['default'] = '<img src="default-banner.jpg" alt=""/>';

    
$banner['AU'] = '<img src="au-banner.jpg" alt=""/>';
    
$banner['DE'] = '<img src="de-banner.jpg" alt=""/>';
    
$banner['US'] = '<img src="us-banner.jpg" alt=""/>';


    
$country_code getenv(GEOIP_COUNTRY_CODE);

    echo (isset(
$banner[$country_code]))
        ? 
$banner[$country_code] : $banner['default'];
?>

And if you wanna to show "nothing" for specified country just add:

PHP Code:
$banner['BE'] = ''
__________________
. . .


. . .

Last edited by Constantine; 12-31-2013 at 05:49 AM.. Reason: just because
Constantine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote