- header("Content-type: application/x-shockwave-flash");
- header("Pragma:");
-
- readfile(dirname(__FILE__).'/geoloc/icon.swf');
- exit;
-
- return PL_NOT_FOUND;
- }
-
- function handler_dynamap(&$page)
- {
- global $globals;
-
- header("Content-type: application/x-shockwave-flash");
-
- header("Pragma:");
- readfile(dirname(__FILE__).'/geoloc/dynamap.swf');
- exit;
-
- return PL_NOT_FOUND;
- }
-
- function handler_init(&$page)
- {
- global $globals;
-
- $page->changeTpl('geoloc/init.tpl', NO_SKIN);
-
- header('Content-type: text/xml');
- header('Pragma:');
- if(!empty($GLOBALS['IS_XNET_SITE']))
- $page->assign('background', 0xF2E9D0);
- $page->assign('querystring', $this->_make_qs());
- }
-
- function handler_city(&$page)
- {
- global $globals;
-
- header("Content-type: text/xml");
- header("Pragma:");
-
- $page->changeTpl('geoloc/city.tpl', NO_SKIN);
-
- require_once dirname(__FILE__).'/search/search.inc.php';
- require_once('geoloc.inc.php');
-
- if (empty($GLOBALS['IS_XNET_SITE'])) {
- $usual_fields = advancedSearchFromInput();
- $fields = new SFieldGroup(true, $usual_fields);
- } else {
- $_REQUEST['asso_id'] = $globals->asso('id');
- $_REQUEST['only_current'] = 'on';
- $fields = new SFieldGroup(true, array(
- new RefSField('asso_id',array('gxm.asso_id'),'groupex.membres','gxm','u.user_id=gxm.uid'),
- new RefSField('cityid',array('av.cityid'),'adresses','av',getadr_join('av'))));
- }
- $where = $fields->get_where_statement();
- if ($where) $where = "WHERE ".$where;
-
- $users = XDB::iterator("
- SELECT u.user_id AS id, u.prenom, u.nom, u.promo, alias
- FROM adresses AS a
- INNER JOIN auth_user_md5 AS u ON(u.user_id = a.uid)
- INNER JOIN auth_user_quick AS q ON(q.user_id = a.uid)
- LEFT JOIN aliases ON(u.user_id = aliases.id AND FIND_IN_SET(aliases.flags,'bestalias'))
- ".$fields->get_select_statement()."
- ".$where."
- GROUP BY u.user_id LIMIT 11", $id);
-
- $page->assign('users', $users);
- }
-
- function handler_country(&$page)
- {
- global $globals;
-
- // to debug sql use the next line
- if (Env::has('debug')) {
- $page->changeTpl('geoloc/country.tpl', SIMPLE);
- } else {
- header("Content-type: text/xml");
- header("Pragma:");
- $page->changeTpl('geoloc/country.tpl', NO_SKIN);
- }
-
- require_once dirname(__FILE__).'/search/search.inc.php';
- require_once 'geoloc.inc.php';
-
- $querystring = $this->_make_qs();
- $page->assign('searchvars', $querystring);
-
- $mapid = Env::has('mapid') ? Env::i('mapid', -2) : false;
- if (empty($GLOBALS['IS_XNET_SITE'])) {
- $fields = advancedSearchFromInput();
- } else {
- $_REQUEST['asso_id'] = $globals->asso('id');
- $_REQUEST['only_current'] = 'on';
- $fields = array(new RefSField('asso_id',array('gxm.asso_id'),'groupex.membres','gxm','u.user_id=gxm.uid'));
- }
-
- list($countries, $cities) = geoloc_getData_subcountries($mapid, $fields, 10);
-
- $page->assign('countries', $countries);
- $page->assign('cities', $cities);