phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file function.geoIP.php

Documentation is available at function.geoIP.php

  1. <?php
  2. /**
  3.  * A smarty plugin to access the GeoIP database.
  4.  * @author Christopher Troup <mini@chatetheory.com>
  5.  * @package phpUserTrack
  6.  */
  7.  
  8. /**
  9.  * Provide a wrapper to the GeoIP database.
  10.  *
  11.  * @param array $params
  12.  * @param object &$smarty
  13.  * @return string The requested field
  14.  */
  15.  
  16. function smarty_function_geoIP($params&$smarty{
  17.  
  18.     if ($geoip @Net_GeoIP::getInstance('./include/GeoLiteCity.dat'Net_GeoIP::STANDARD)) {
  19.         $ip $params['ip'];
  20.         if ($location $geoip->lookupLocation($ip)) {
  21.             //return $location;
  22.             return $location->$params['field'];
  23.         }
  24.     }
  25. }
  26.  
  27. ?>

Documentation generated on Tue, 06 Nov 2007 09:21:39 -0800 by phpDocumentor 1.4.0a2