예제 #1
0
function set_paged_pics($purpose, $userid, $cacheid, $url)
{
    global $tpl;
    $startat = isset($_REQUEST['startat']) ? $_REQUEST['startat'] + 0 : 0;
    $pictures = get_logpics($purpose, $userid, $cacheid);
    $tpl->assign('pictures', array_slice($pictures, $startat, MAX_PICTURES_PER_GALLERY_PAGE));
    $pager = new pager($url . "&startat={offset}");
    $pager->make_from_offset($startat, count($pictures), MAX_PICTURES_PER_GALLERY_PAGE);
}
예제 #2
0
$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', get_logpics(LOGPICS_FOR_USER_STAT, $userid));
    } else {
        set_paged_pics(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 = more than 12 months
 *   5 = unknown, we need this, because we dont
예제 #3
0
// 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', get_logpics(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
예제 #4
0
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) {
    set_paged_pics(LOGPICS_FOR_CACHE_GALLERY, 0, $cacheid, "viewcache.php?cacheid=" . $cacheid . "&logpics=1");
    $tpl->assign('subtitle', "&lt;&lt; <a href='viewcache.php?cacheid=" . $cacheid . "'>" . $translate->t('Back to the cache description', '', basename(__FILE__), __LINE__) . "</a>");
} else {
    $tpl->assign('logpics', get_logpics(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']);
예제 #5
0
파일: myhome.php 프로젝트: 4Vs/oc-server3
$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\t                                    `user`.`user_id` AS `userid`, `user`.`username`, `caches`.`wp_oc`, `ca`.`attrib_id` IS NOT NULL AS `oconly`,\n\t                                    `cache_rating`.`rating_date` IS NOT NULL AS `recommended`\n\t                               FROM `cache_logs`\n\t                         INNER JOIN `caches` ON `cache_logs`.`cache_id`=`caches`.`cache_id`\n\t                         INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`\n\t                          LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6\n\t                          LEFT JOIN `cache_rating` ON `cache_rating`.`cache_id`=`caches`.`cache_id` AND `cache_rating`.`user_id`=`cache_logs`.`user_id` AND `cache_rating`.`rating_date`=`cache_logs`.`date`\n\t                              WHERE `cache_logs`.`user_id`='&1'\n\t                           ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`date_created` DESC\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t    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\t\t                                    `caches`.`date_hidden`, `caches`.`status`, `caches`.`wp_oc`,\n\t\t                                    `found`,\n\t\t                                    `ca`.`attrib_id` IS NOT NULL AS `oconly`,\n\t\t                                    MAX(`cache_logs`.`date`) AS `lastlog`,\n\t\t                                    (SELECT `type` FROM `cache_logs` `cl2`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE `cl2`.`cache_id`=`caches`.`cache_id`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   ORDER BY `date` DESC,`id` DESC LIMIT 1) AS `lastlog_type` \n\t                                 FROM `caches`\n\t                            LEFT JOIN `stat_caches` ON `stat_caches`.`cache_id`=`caches`.`cache_id`\n\t                            LEFT JOIN `cache_logs` ON `cache_logs`.`cache_id`=`caches`.`cache_id`\n\t                            LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6\n\t                                WHERE `caches`.`user_id`='&1'\n\t                                  AND `caches`.`status` != 5\n\t                             GROUP BY `caches`.`cache_id`\n\t                             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`, `caches`.`date_activate`, `caches`.`status`, `caches`.`wp_oc`, `caches`.`type`\n\t                                       FROM `caches`\n\t                                      WHERE `user_id`='&1'\n\t                                        AND `caches`.`status` = 5\n\t                                   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 = get_logpics(LOGPICS_FOR_MYHOME_GALLERY);
if ($allpics) {
    set_paged_pics(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();
예제 #6
0
<?php

/***************************************************************************
 *  For license information see doc/license.txt
 *
 *  Unicode Reminder メモ
 ***************************************************************************/
require './lib2/web.inc.php';
require './lib2/logic/logpics.inc.php';
$tpl->name = 'newlogpics';
$tpl->menuitem = MNU_START_NEWLOGPICS;
$tpl->caching = true;
$tpl->cache_lifetime = 300;
if (!$tpl->is_cached()) {
    $tpl->assign('pictures', get_logpics(LOGPICS_FOR_NEWPICS_GALLERY));
}
$tpl->display();