예제 #1
0
     $tpl->assign('forum', $getNew->feedForSmarty('forum'));
 } else {
     $tpl->assign('phpbb_enabled', false);
     $tpl->assign('forum', '');
 }
 $phpbb_topics = array();
 $tpl->assign('phpbb_topics', $phpbb_topics);
 //        $tpl->assign('phpbb_enabled', ($opt['cron']['phpbbtopics']['url'] != ''));
 $tpl->assign('phpbb_name', $opt['cron']['phpbbtopics']['name']);
 $tpl->assign('phpbb_link', $opt['cron']['phpbbtopics']['link']);
 // current cache and log-counters
 $tpl->assign('count_hiddens', number1000(sql_value_slave('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status`=1', 0)));
 $tpl->assign('count_founds', number1000(sql_value_slave('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type`=1', 0)));
 $tpl->assign('count_users', number1000(sql_value_slave('SELECT COUNT(*) AS `users` FROM (SELECT DISTINCT `user_id` FROM `cache_logs` UNION DISTINCT SELECT DISTINCT `user_id` FROM `caches`) AS `t`', 0)));
 // get newest events
 $tpl->assign_rs('events', $getNew->rsForSmarty('event'));
 // get total event count for all countries
 $tpl->assign('total_events', sql_value_slave("SELECT COUNT(*) FROM `caches` WHERE `type`=6 AND `date_hidden` >= curdate() AND `status`=1", 0));
 // get newest caches
 $tpl->assign_rs('newcaches', $getNew->rsForSmarty('cache'));
 // 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);
예제 #2
0
    if (isset($opt['page']['404'][$_SERVER['SERVER_NAME']][$option])) {
        $opt404[$option] = $opt['page']['404'][$_SERVER['SERVER_NAME']][$option];
    } else {
        $opt404[$option] = $opt['page']['404']['www.opencaching.de'][$option];
    }
    if ($opt404[$option]['urlname'] == '') {
        $opt404[$option]['urlname'] = parse_url($opt404[$option]['url'], PHP_URL_HOST);
    }
}
// get feeds from $feeds array
foreach ($feeds as $feed) {
    if ($isRedirect404) {
        if ($opt404[$feed]['show']) {
            $tpl->assign($feed, $getNew->feedForSmarty($feed, 3, $opt404[$feed]['feedurl'], $opt404[$feed]['timeout']));
        }
    } else {
        $tpl->assign($feed, $getNew->feedForSmarty($feed, 3));
    }
}
// get newest caches
if ($isRedirect404) {
    if ($opt404['newcaches']['show']) {
        $tpl->assign_rs('newcaches', $getNew->rsForSmarty('cache', [$sUserCountry, $opt['template']['locale'], 3]));
    }
} else {
    $tpl->assign_rs('newcaches', $getNew->rsForSmarty('cache', [$sUserCountry, $opt['template']['locale'], 3]));
}
// assign $opt404
$tpl->assign('opt404', $opt404);
// show page
$tpl->display();