setQuery( $query ); $options = $database->loadObjectList(); $r = ' '; foreach ($options as $o) { $r .= "\n"; $r .= "'; $r .= "\n"; } $r .= "
nameidtypeposition
".$o->title.''.$o->id.''.$o->module.''.$o->position.'
"; return $r; } function _form_help( $name, $value, &$node, $control_name ) { return 'Create some PHP code to determine which module should be used. Once the script has decided which module or modules to display, return the module id, a comma-separated list of module ids as a string, or an array of module ids. For more help and recipes, see the MetaMod home page. e.g.
if (time() >= strtotime("1 Oct 2007") && time() < strtotime("30 Oct 2007")) return 74;
if (time() < strtotime("1 Nov 2008")) return 75;
if ($fromCountryId == "US") return 55;
if ($fromCountryId == "GB") return "55,56,57";
if ($fromCountryId == "NL") return array(58,59,73);
if ($fromCountryName == "New Zealand") return 21;

You have access to the following PHP variables:

Note: $fromCountryName and $fromCountryId will only be available if you have one of the "Enable GeoIP" options selected above, and if you have one of the GeoLite Country, GeoIP Country, GeoLiteCity or GeoIPCity databases installed (see Maxmind, direct GeoLite Country download, or direct GeoLite City download)'; } function _form_geoipcheck( $name, $value, &$node, $control_name ) { global $mosConfig_absolute_path; $files = $this->geoIPFolders(); foreach ($files as $file) { $country = file_exists($mosConfig_absolute_path.$file.'/GeoIP.dat'); $litecity = file_exists($mosConfig_absolute_path.$file.'/GeoLiteCity.dat'); $city = file_exists($mosConfig_absolute_path.$file.'/GeoIPCity.dat'); $messages = array(); if ($country) { $age = intval((time() - filemtime($mosConfig_absolute_path.$file.'/GeoIP.dat'))/(24*60*60)); if ($age > 30) $age = "File is $age days old. Please update your database from MaxMind."; else $age = ""; $messages[] = $file."/GeoIP.dat found. All GeoIP Country features enabled. $age"; } if ($litecity) { $age = intval((time() - filemtime($mosConfig_absolute_path.$file.'/GeoLiteCity.dat'))/(24*60*60)); if ($age > 30) $age = "File is $age days old. Please update your database from MaxMind."; else $age = ""; $messages[] = $file."/GeoLiteCity.dat found. All GeoIP City/region features enabled. $age"; } if ($city) { $age = intval((time() - filemtime($mosConfig_absolute_path.$file.'/GeoIPCity.dat'))/(24*60*60)); if ($age > 30) $age = "File is $age days old. Please update your database from MaxMind."; else $age = ""; $messages[] = $file."/GeoIPCity.dat found. All GeoIP City/region features enabled. $age"; } if ($country || $litecity || $city) { return "".implode("
",$messages).'

Keep your GeoIP databases up to date from MaxMind'; } } return 'I couldn\'t find any GeoIP database at jooma_root/geoip/GeoIP.dat or GeoFreeCity.dat or GeoIPCity.dat.
If you want to use the GeoIP Country features, please obtain the GeoLite Country or GeoIP Country database at MaxMind (direct download), uncompress it, and install it as jooma_root/geoip/GeoIP.dat. For full City and location features, please obtain the GeoLite City or GeoIP City database at MaxMind, uncompress it, and install it as jooma_root/geoip/GeoLiteCity.dat'; } function geoIPFolders() { return array( "/geoip", "/GeoIP", "/geoIP", "/GEOIP", "/GEO IP", "/", "/geo_ip", "/geo_IP", "/Geo_IP" ); } }