bugfixes (cachelink translatable, logtype via GET, permission check for

teamcomment), updates #206, updates #241
This commit is contained in:
Nils Bohrs
2013-07-17 13:00:58 +02:00
committed by following
parent 2cb201b5f0
commit c95c4e9746
4 changed files with 52 additions and 11 deletions
+25
View File
@@ -425,6 +425,20 @@ class cache
return true;
}
// checks if $userId has adopted this cache
function hasAdopted($userId)
{
// cache_adoption exists?
return (sql_value("
SELECT COUNT(*)
FROM `cache_adoption`
WHERE `cache_id`='&1'
AND `user_id`='&2'",
0,
$this->nCacheId,
$userId) != 0);
}
// true if anyone can view the cache
function isPublic()
@@ -609,5 +623,16 @@ class cache
// checks if teamcomment is allowed
return teamcomment_allowed($this->getCacheId(), $logType, $oldTeamComment);
}
function statusUserLogAllowed()
{
return (sql_value("
SELECT `cache_status`.`allow_user_log`
FROM `cache_status`,`caches`
WHERE `caches`.`status`=`cache_status`.`id`
AND `caches`.`cache_id`='&1'",
0,
$this->getCacheId()) == 1);
}
}
?>
+7
View File
@@ -1282,5 +1282,12 @@ class user
return ($opt['logic']['rating']['percentageOfFounds'] - ($this->getStatFound() % $opt['logic']['rating']['percentageOfFounds']));
}
function showStatFounds()
{
// wether to show the number of founds on log page
// TODO: make customisable in user profile, see #241
return false;
}
}
?>