// create object for "newest" information $getNew = new getNew($sUserCountry); $tpl->name = 'start'; $tpl->menuitem = MNU_START; $tpl->caching = true; $tpl->cache_lifetime = 300; $tpl->cache_id = $sUserCountry . '|' . $opt['page']['protocol']; if (!$tpl->is_cached()) { // welcome message if (isset($opt['page']['message'])) { $tpl->assign('message', $opt['page']['message']); } else { $tpl->assign('message', $translate->t('You can find everything you need to go Geocaching ...', '', '', 0)); } // pictures $tpl->assign('pictures', LogPics::get(LogPics::FOR_STARTPAGE_GALLERY)); // news entries $tpl->assign('news_onstart', $opt['news']['onstart']); if ($opt['news']['include'] == '') { $news = array(); $rs = sql_slave('SELECT `news`.`date_created` `date`, `news`.`content` `content`, `news_topics`.`name` `topic` FROM `news` INNER JOIN `news_topics` ON (`news`.`topic` = `news_topics`.`id`) WHERE `news`.`display` = 1 ORDER BY `news`.`date_created` DESC LIMIT 0, 6'); $tpl->assign_rs('news', $rs); sql_free_result($rs); $tpl->assign('extern_news', false); } else { /* * changed by bohrsty to fix error in displaying news from blog
$tpl->assign('active', $active); $tpl->assign('recommended', sql_value("SELECT COUNT(*) FROM `cache_rating` WHERE `user_id`='&1'", 0, $userid)); $tpl->assign('maxrecommended', floor($record['found'] * $opt['logic']['rating']['percentageOfFounds'] / 100)); $tpl->assign('show_statistics', $show_statistics); $tpl->assign('show_oconly81', $show_oconly81); $tpl->assign('oconly_hidden', $oconly_hidden); $tpl->assign('oconly_hidden_active', $oconly_hidden_active); $tpl->assign('oconly_recommended', $oconly_recommended); $user = new user($userid); $picstat = $useropt->getOptValue(USR_OPT_PICSTAT) == 1 && !$user->getLicenseDeclined(); $tpl->assign('show_picstat', $picstat); if ($picstat) { // user has allowed picture stat and gallery view $tpl->assign('allpics', $allpics); if (!$allpics) { $tpl->assign('logpics', LogPics::get(LogPics::FOR_USER_STAT, $userid)); } else { LogPics::setPaging(LogPics::FOR_USER_GALLERY, $userid, 0, "viewprofile.php?userid=" . $userid . "&allpics=1"); $tpl->name = 'viewprofile_pics'; // actually we dont need all the other stuff here .. } } $tpl->assign('showcountry', strlen(trim($record['country'])) > 0); $tpl->assign('country', $record['country']); $tpl->assign('registered', $record['date_created']); /* set last_login to one of 5 categories * 1 = this month or last month * 2 = between one and 6 months * 3 = between 6 and 12 months * 4 = between 12 and 24 months * 5 = more than 12 months
<?php /*************************************************************************** * For license information see doc/license.txt * * Unicode Reminder メモ ***************************************************************************/ require __DIR__ . '/lib2/web.inc.php'; $tpl->name = 'newlogpics'; $tpl->menuitem = MNU_START_NEWLOGPICS; $tpl->caching = true; $tpl->cache_lifetime = 300; if (!$tpl->is_cached()) { $tpl->assign('pictures', LogPics::get(LogPics::FOR_NEWPICS_GALLERY)); } $tpl->display();
$tpl->assign('hidden', $rUser['hidden']); //get last logs sql_enable_foundrows(); $tpl->assign_rs('logs', sql("SELECT SQL_CALC_FOUND_ROWS `cache_logs`.`cache_id` `cacheid`, `cache_logs`.`type` `type`, `cache_logs`.`date` `date`, `caches`.`name` `name`,\n `user`.`user_id` AS `userid`, `user`.`username`, `caches`.`wp_oc`, `ca`.`attrib_id` IS NOT NULL AS `oconly`,\n `cache_rating`.`rating_date` IS NOT NULL AND `cache_logs`.`type` IN (1,7) AS `recommended`,\n `cache_logs`.`needs_maintenance`,\n `cache_logs`.`listing_outdated`\n FROM `cache_logs`\n INNER JOIN `caches` ON `cache_logs`.`cache_id`=`caches`.`cache_id`\n INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`\n LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id`\n AND `ca`.`attrib_id`=6\n LEFT JOIN `cache_rating` ON `cache_rating`.`cache_id`=`caches`.`cache_id`\n AND `cache_rating`.`user_id`=`cache_logs`.`user_id` AND `cache_rating`.`rating_date`=`cache_logs`.`date`\n WHERE `cache_logs`.`user_id`='&1'\n ORDER BY `cache_logs`.`order_date` DESC, `cache_logs`.`date_created` DESC, `cache_logs`.`id` DESC\n LIMIT 10", $login->userid)); $tpl->assign('morelogs', sql_value("SELECT FOUND_ROWS()", 0) > 10); sql_foundrows_done(); //get last hidden caches $tpl->assign_rs('caches', sql("SELECT `caches`.`cache_id`, `caches`.`name`, `caches`.`type`,\n `caches`.`date_hidden`, `caches`.`status`, `caches`.`wp_oc`,\n IF(`caches`.`needs_maintenance`, 2, 0) AS `needs_maintenance`,\n IF(`caches`.`listing_outdated`, 2, 0) AS `listing_outdated`,\n `stat_caches`.`found`,`stat_caches`.`toprating`,\n `ca`.`attrib_id` IS NOT NULL AS `oconly`,\n MAX(`cache_logs`.`date`) AS `lastlog`,\n (SELECT `type` FROM `cache_logs` `cl2`\n WHERE `cl2`.`cache_id`=`caches`.`cache_id`\n ORDER BY `order_date` DESC, `date_created` DESC, `id` DESC LIMIT 1) AS `lastlog_type`\n FROM `caches`\n LEFT JOIN `stat_caches` ON `stat_caches`.`cache_id`=`caches`.`cache_id`\n LEFT JOIN `cache_logs` ON `cache_logs`.`cache_id`=`caches`.`cache_id`\n LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6\n WHERE `caches`.`user_id`='&1'\n AND `caches`.`status` != 5\n GROUP BY `caches`.`cache_id`\n ORDER BY `caches`.`date_hidden` DESC, `caches`.`date_created` DESC", $login->userid)); if ($useragent_msie && $useragent_msie_version < 9) { $tpl->assign('dotfill', ''); } else { $tpl->assign('dotfill', '...........................................................................................................'); } $tpl->add_body_load('myHomeLoad()'); //get not published caches $tpl->assign_rs('notpublished', sql("SELECT `caches`.`cache_id`, `caches`.`name`, `caches`.`date_hidden`,\n `caches`.`date_activate`, `caches`.`status`, `caches`.`wp_oc`, `caches`.`type`\n FROM `caches`\n WHERE `user_id`='&1'\n AND `caches`.`status` = 5\n ORDER BY `date_activate` DESC, `caches`.`date_created` DESC", $login->userid)); // get number of sent emails // useless information when email protocol is cleaned-up (cronjob 'purge_logs') // $tpl->assign('emails', sql_value("SELECT COUNT(*) FROM `email_user` WHERE `from_user_id`='&1'", 0, $login->userid)); // get log pictures $allpics = isset($_REQUEST['allpics']) && $_REQUEST['allpics']; $all_pictures = LogPics::get(LogPics::FOR_MYHOME_GALLERY); if ($allpics) { LogPics::setPaging(LogPics::FOR_MYHOME_GALLERY, 0, 0, "myhome.php?allpics=1"); } else { $tpl->assign('pictures', $all_pictures); } $tpl->assign('allpics', $allpics ? 1 : 0); $tpl->assign('total_pictures', count($all_pictures)); // display $tpl->display();
if (isset($_REQUEST['print']) && $_REQUEST['print'] == 'y') { $tpl->popup = 1; $tpl->assign('print', true); $tpl->name = 'viewcache_print'; $tpl->assign('log', $_REQUEST['log']); } else { $tpl->assign('print', false); } /* logpics */ $tpl->assign('show_logpics', $logpics ? 1 : 0); if ($logpics) { LogPics::setPaging(LogPics::FOR_CACHE_GALLERY, 0, $cacheid, "viewcache.php?cacheid=" . $cacheid . "&logpics=1"); $tpl->assign('subtitle', "<< <a href='viewcache.php?cacheid=" . $cacheid . "'>" . $translate->t('Back to the cache description', '', basename(__FILE__), __LINE__) . "</a>"); } else { $tpl->assign('logpics', LogPics::get(LogPics::FOR_CACHE_STAT, 0, $cacheid)); } /* process profile settings */ $userzoom = 11; if ($login->userid > 0) { $useropt = new useroptions($login->userid); $userzoom = $useropt->getOptValue(USR_OPT_GMZOOM); $autoload_logs = $useropt->getOptValue(USR_OPT_LOG_AUTOLOAD); } else { $autoload_logs = true; } $tpl->assign('userzoom', $userzoom); $tpl->assign('autoload_logs', $autoload_logs); // get the correct mapkey $sHost = strtolower($_SERVER['HTTP_HOST']);