{'System/BaseURL'} ) { # this is homepage $match = " and ((do_where='1') or (do_where='3')) "; } # we want to extend match by checking the country via geoip require_once "Net/GeoIP.php"; $geoip = Net_GeoIP::getInstance("/var/www/html/recipebridge.com/html/geo/GeoIP.dat"); try { $cc = $geoip->lookupCountryCode($_SERVER['REMOTE_ADDR']); #echo $geoip->lookupCountryCode('71.0.170.218'); } catch (Exception $e) { // Handle exception } # do we have some defined country? if ($cc != '') { # apply it to the match $match = $match." and ((country='ANY') or (country='".$cc."')) "; } $Query = " SELECT * FROM backgrounds where status='1' $match order by rand() limit 1;"; #echo '
Q:'.$Query; $rbg = $DatabaseObj->fetchAll($Query); foreach ($rbg as $Result) { ################# # we need to deal with the new background options # if they are set we will apply them if ($Result->do_background_color != '-1') { # we have some background color $the_color = $Result->do_background_color; # background color -- this is a css modification ?> do_position; $top = $Result->do_top; # we have to modify the top based on the home page or other page # what is our page? #echo "

".$this->{'System/BaseURL'}."

"; #print_r($_SERVER); # adjust positon if FIXED to offset header (and zero top) $cval = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; if ($position == 'absolute') if ( $cval == $this->{'System/BaseURL'} ) { $top = 44; } else { $top = 111; } $left = $Result->do_left; ?> do_width; if ($width != '0') { # we have some set width ?> new_window == '0') { $nw = ''; } else { $nw = ' target="_blank" '; } $t_file = '/var/www/html/recipebridge.com/html/backgrounds/'.$Result->file_name; $t_url = $this->{'System/BaseURL'}.'backgrounds/'.$Result->file_name; if (file_exists($t_file)) { # yes show it # we are showing the image directly...and activating the click logic #echo ' '; echo 'image description'; ############ # script to activate click ?> '; } } # end foreach (should be only 1) ?>