$page->changeTpl('geoloc/index.tpl');
- $res = $globals->xdb->query('SELECT COUNT(DISTINCT uid)
+ $res = XDB::query('SELECT COUNT(DISTINCT uid)
FROM adresses WHERE cityid IS NOT NULL');
$page->assign('localises', $res->fetchOneCell());
$fields = new SFieldGroup(true, advancedSearchFromInput());
$search = $fields->get_url();
- if (Env::has('only_current') && Env::get('only_current') != 'on') {
+ if (Env::has('only_current') && Env::v('only_current') != 'on') {
$search .= '&only_current=';
}
$search = preg_replace('/(^|&)mapid=([0-9]+)(&|$)/','\1\3', $search);
}
$page->assign('use_map', $globals->geoloc->use_map());
-
- return PL_OK;
}
function handler_icon(&$page)
$querystring = $this->_make_qs();
$initfile = urlencode('geolocInit.php?'.$querystring);
- if (urlencode(Env::get('initfile')) != $initfile) {
+ if (urlencode(Env::v('initfile')) != $initfile) {
header("Location: dynamap.php?initfile=$initfile{$querystring}");
die();
}
{
global $globals;
- new_nonhtml_page('geoloc/geolocInit.tpl', AUTH_COOKIE);
+ $page->changeTpl('geoloc/geolocInit.tpl', NO_SKIN);
header('Content-type: text/xml');
$page->assign('querystring', $this->_make_qs());
-
- return PL_OK;
}
function handler_city(&$page)
header("Content-type: text/xml");
- new_nonhtml_page('geoloc/getCityInfos.tpl', AUTH_COOKIE);
- // to debug sql use the next line
- //new_skinned_page('', AUTH_COOKIE);
+ $page->changeTpl('geoloc/getCityInfos.tpl', NO_SKIN);
require_once('geoloc.inc.php');
require_once('search.inc.php');
$where = $fields->get_where_statement();
if ($where) $where = "WHERE ".$where;
- $users = $globals->xdb->iterator("
+ $users = XDB::iterator("
SELECT u.user_id AS id, u.prenom, u.nom, u.promo
FROM adresses AS a
INNER JOIN auth_user_md5 AS u ON(u.user_id = a.uid)
GROUP BY u.user_id LIMIT 11", $id);
$page->assign('users', $users);
-
- return PL_OK;
}
function handler_data(&$page)
// to debug sql use the next line
if (Env::has('debug')) {
- $page->changeTpl('geoloc/getData.tpl');
- $page->assign('simple', true);
+ $page->changeTpl('geoloc/getData.tpl', SIMPLE);
} else {
header("Content-type: text/xml");
- new_nonhtml_page('geoloc/getData.tpl', AUTH_COOKIE);
+ $page->changeTpl('geoloc/getData.tpl', NO_SKIN);
}
require_once 'geoloc.inc.php';
$querystring = $this->_make_qs();
$page->assign('searchvars', $querystring);
- $mapid = Env::has('mapid') ? Env::getInt('mapid', -2) : false;
+ $mapid = Env::has('mapid') ? Env::i('mapid', -2) : false;
list($countries, $cities) = geoloc_getData_subcountries($mapid, advancedSearchFromInput(), 10);
$page->assign('countries', $countries);
$page->assign('cities', $cities);
-
- return PL_OK;
}
}