cvs: phpweb /include ip-to-country.inc /user css.php

From: Date: Sat, 03 May 2003 20:06:02 +0000
Subject: cvs: phpweb /include ip-to-country.inc /user css.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-17265@lists.php.net to get a copy of this message
goba Sat May 3 16:06:02 2003 EDT Modified files: /phpweb/user css.php /phpweb/include ip-to-country.inc Log: Let the country validity check at one place, as we will need it more then once Index: phpweb/user/css.php diff -u phpweb/user/css.php:1.1 phpweb/user/css.php:1.2 --- phpweb/user/css.php:1.1 Sat May 3 12:29:40 2003 +++ phpweb/user/css.php Sat May 3 16:06:01 2003 @@ -1,5 +1,5 @@ <?php -/* $Id: css.php,v 1.1 2003/05/03 16:29:40 goba Exp $ */ +/* $Id: css.php,v 1.2 2003/05/03 20:06:01 goba Exp $ */ include_once "prepend.inc"; @@ -8,6 +8,6 @@ // If we have a valid country, output a CSS rule // marking the events in the user's country specially -if (!empty($COUNTRY) && $COUNTRY != "NA") { +if (i2c_valid_country()) { echo ".event_$COUNTRY { font-weight: bold; }"; -} \ No newline at end of file +} Index: phpweb/include/ip-to-country.inc diff -u phpweb/include/ip-to-country.inc:1.4 phpweb/include/ip-to-country.inc:1.5 --- phpweb/include/ip-to-country.inc:1.4 Sat May 3 11:33:16 2003 +++ phpweb/include/ip-to-country.inc Sat May 3 16:06:01 2003 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- -// $Id: ip-to-country.inc,v 1.4 2003/05/03 15:33:16 goba Exp $ +// $Id: ip-to-country.inc,v 1.5 2003/05/03 20:06:01 goba Exp $ /* @@ -179,3 +179,10 @@ // Return with the country found return $country; } + +// Check if the current country is valid +function i2c_valid_country() +{ + global $COUNTRY; + return (!empty($COUNTRY) && $COUNTRY != "NA"); +} \ No newline at end of file

« previous php.mirrors (#17265) next »