当前位置: 首页>>代码示例>>PHP>>正文


PHP cache::isRecommendedByUser方法代码示例

本文整理汇总了PHP中cache::isRecommendedByUser方法的典型用法代码示例。如果您正苦于以下问题:PHP cache::isRecommendedByUser方法的具体用法?PHP cache::isRecommendedByUser怎么用?PHP cache::isRecommendedByUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cache的用法示例。


在下文中一共展示了cache::isRecommendedByUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cache

// proceed loggable, if valid cache_id
$validate['logAllowed'] = true;
if ($cacheId != 0) {
    // get cache object
    $cache = new cache($cacheId);
    // check log allowed, depending on cache state and logged in user
    $validate['logAllowed'] = $cache->allowLog();
    // get user object
    $user = new user($login->userid);
    // is user cache owner
    $isOwner = $user->getUserId() == $cache->getUserId();
    // assing ratings to template
    $tpl->assign('ratingallowed', $user->allowRatings());
    $tpl->assign('givenratings', $user->getGivenRatings());
    $tpl->assign('maxratings', $user->getMaxRatings());
    $tpl->assign('israted', $cache->isRecommendedByUser($user->getUserId()));
    $tpl->assign('foundsuntilnextrating', $user->foundsUntilNextRating());
    $tpl->assign('isowner', $isOwner);
    // check and prepare form values
    $datesaved = isset($_COOKIE['oclogdate1']) && isset($_COOKIE['oclogdate2']);
    if ($datesaved) {
        $defaultLogYear = substr($_COOKIE['oclogdate1'], 0, 4);
        $defaultLogMonth = substr($_COOKIE['oclogdate1'], 4, 2);
        $defaultLogDay = substr($_COOKIE['oclogdate1'], 6, 2);
    }
    // check if masslog warning is accepted (in cookie)
    $masslogCookieSet = isset($_COOKIE['ocsuppressmasslogwarn']);
    if ($masslogCookieSet) {
        $masslogCookieContent = $_COOKIE['ocsuppressmasslogwarn'] + 0;
    } else {
        // save masslog acception in cookie that expires on midnight if clicked
开发者ID:kirstenko,项目名称:oc-server3,代码行数:31,代码来源:log.php

示例2: strtolower

    $tpl->add_header_javascript('resource2/tinymce/config/log.js.php?logid=0&lang=' . strtolower($opt['template']['locale']));
} else {
    $tpl->assign('smileys', smileys::getSmileysArray());
}
// build logtype list
$rs = sql("SELECT `log_types`.`id`, IFNULL(`sys_trans_text`.`text`, `log_types`.`name`) AS `name`\r\n\t             FROM `caches` \r\n\t       INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id` \r\n\t       INNER JOIN `cache_logtype` ON `cache_type`.`id`=`cache_logtype`.`cache_type_id` \r\n\t       INNER JOIN `log_types` ON `cache_logtype`.`log_type_id`=`log_types`.`id` \r\n\t        LEFT JOIN `sys_trans` ON `log_types`.`trans_id`=`sys_trans`.`id` \r\n\t        LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' \r\n\t            WHERE `caches`.`cache_id`='&2'", $opt['template']['locale'], $nCacheId);
$tpl->assign_rs('logtypes', $rs);
sql_free_result($rs);
$tpl->assign('logType', $nLogType);
$tpl->assign('descMode', $nDescMode);
if ($nDescMode != 1) {
    $tpl->assign('logText', htmlspecialchars($sLogText, ENT_COMPAT, 'UTF-8'), true);
} else {
    $tpl->assign('logText', $sLogText);
}
$tpl->assign('noLogTypeSelected', $noLogTypeSelected);
$tpl->assign('dateFormatInvalid', !$bDateFormatValid);
$tpl->assign('requireLogPW', $cache->requireLogPW());
$tpl->assign('logPWValid', $bLogPWValid);
$tpl->assign('logDateDay', $nLogDateDay);
$tpl->assign('logDateMonth', $nLogDateMonth);
$tpl->assign('logDateYear', $nLogDateYear);
$tpl->assign('userRecommended', $cache->isRecommendedByUser($login->userid));
$tpl->assign('userRecommendationPossible', $nUserRecommendationPossible);
$tpl->assign('userRecommendationUsed', $nUserRecommendationUsed);
$tpl->assign('userRecommendationRequiredFinds', $nUserRecommendationRequiredFinds);
// TODO: $cache->getTemplateInfo()
$rCache['cacheid'] = $nCacheId;
$rCache['cachename'] = $cache->getName();
$tpl->assign('cache', $rCache);
$tpl->display();
开发者ID:RH-Code,项目名称:opencaching,代码行数:31,代码来源:log2.php


注:本文中的cache::isRecommendedByUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。