本文整理汇总了PHP中cache::allowLog方法的典型用法代码示例。如果您正苦于以下问题:PHP cache::allowLog方法的具体用法?PHP cache::allowLog怎么用?PHP cache::allowLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cache
的用法示例。
在下文中一共展示了cache::allowLog方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createNew
static function createNew($nCacheId, $nUserId)
{
global $opt;
// check if user is allowed to log this cache!
$cache = new cache($nCacheId);
if ($cache->exist() == false) {
return false;
}
if ($cache->allowLog() == false) {
return false;
}
$oCacheLog = new cachelog(ID_NEW);
$oCacheLog->setUserId($nUserId);
$oCacheLog->setCacheId($nCacheId);
$oCacheLog->setNode($opt['logic']['node']['id']);
return $oCacheLog;
}
示例2: cache
$tpl->error(ERROR_INVALID_OPERATION);
}
$nCacheId = $cachelog->getCacheId();
} else {
$cachelog = cachelog::createNew($nCacheId, $login->userid);
if ($cachelog === false) {
$tpl->error(ERROR_INVALID_OPERATION);
}
$cachelog->setNode($opt['logic']['node']['id']);
}
// check cache exists
$cache = new cache($nCacheId);
if ($cache->exist() == false) {
$tpl->error(ERROR_CACHE_NOT_EXISTS);
}
if ($cache->allowLog() == false) {
$tpl->error(ERROR_INVALID_OPERATION);
}
/* read submitted data
*/
$nDescMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 0;
if ($nDescMode < 1 || $nDescMode > 3) {
$nDescMode = 0;
}
if ($nDescMode == 0) {
if (sql_value("SELECT `no_htmledit_flag` FROM `user` WHERE `user_id`='&1'", 1, $login->userid) == 1) {
$nDescMode = 1;
} else {
$nDescMode = 3;
}
}
示例3: array
$cacheId = $_REQUEST['cacheid'];
}
// check adminstatus of user
$useradmin = $login->hasAdminPriv() ? 1 : 0;
// prepare array to indicate errors in template
$validate = array();
// log and cache type which can be combined with maintenance state flags
$rs = sql("SELECT `id` FROM `log_types` WHERE `maintenance_logs`");
$logtype_allows_nm = sql_fetch_column($rs);
// 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);
示例4: getValidLogTypes
function getValidLogTypes()
{
$cache = new cache($this->getCacheId());
if ($cache->exist() == false) {
return array();
}
if ($cache->allowLog() == false) {
return array();
}
$nTypes = array();
$rs = sql("SELECT `log_type_id` FROM `cache_logtype` WHERE `cache_type_id`='&1'", $cache->getType());
while ($r = sql_fetch_assoc($rs)) {
$nTypes[] = $r['log_type_id'];
}
sql_free_result($rs);
return $nTypes;
}