Exemplo n.º 1
0
    // enable minimap for new caches if url is set
    if ($opt['logic']['minimapurl'] != '') {
        // get the correct api key for google maps
        $gmkey = '';
        $sHost = strtolower($_SERVER['HTTP_HOST']);
        if (isset($opt['lib']['google']['mapkey'][$sHost])) {
            $gmkey = $opt['lib']['google']['mapkey'][$sHost];
        }
        // build static maps url by inserting api key
        $url = $opt['page']['protocol'] . strstr($opt['logic']['minimapurl'], '://');
        $url = mb_ereg_replace('{gmkey}', $gmkey, $url);
        // put into template
        $tpl->assign('minimap_url', $url);
        $tpl->assign('minimap_enabled', true);
    } else {
        $tpl->assign('minimap_enabled', false);
    }
    // last 30 days' top ratings
    $tpl->assign_rs('topratings', $getNew->rsForSmarty('rating'));
    $tpl->assign('toprating_days', $getNew->ratingDays());
    // country and language parameters
    $sUserCountryName = sql_value("SELECT IFNULL(`sys_trans_text`.`text`, `countries`.`name`)\n             FROM `countries`\n        LEFT JOIN `sys_trans` ON `countries`.`trans_id`=`sys_trans`.`id`\n        LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&2'\n            WHERE `countries`.`short`='&1'", '', $sUserCountry, $opt['template']['locale']);
    $tpl->assign('usercountry', $sUserCountryName);
    $tpl->assign('usercountryCode', $sUserCountry);
    if ($opt['template']['locale'] == $opt['page']['main_locale']) {
        $tpl->assign('sections', array('news', 'events', 'logpics', 'recommendations', 'forum', 'newcaches'));
    } else {
        $tpl->assign('sections', array('events', 'recommendations', 'newcaches', 'logpics', 'forum', 'news'));
    }
}
$tpl->display();