fixed rating-date bug introduced with log.php port to lib2

This commit is contained in:
following
2013-08-03 14:01:54 +02:00
parent 21f99393aa
commit ac1464cfba
2 changed files with 3 additions and 3 deletions

View File

@ -486,10 +486,10 @@ class cache
{
return (sql_value("SELECT COUNT(*) FROM `cache_rating` WHERE `cache_id`='&1' AND `user_id`='&2'", 0, $this->nCacheId, $nUserId) > 0);
}
function addRecommendation($nUserId)
function addRecommendation($nUserId, $logdate)
{
// rating_date will be set to NOW() by Insert-trigger
sql("INSERT IGNORE INTO `cache_rating` (`cache_id`, `user_id`) VALUES ('&1', '&2')", $this->nCacheId, $nUserId);
sql("INSERT IGNORE INTO `cache_rating` (`cache_id`, `user_id`, `rating_date`) VALUES ('&1', '&2', '&3')", $this->nCacheId, $nUserId, $logdate);
}
function removeRecommendation($nUserId)
{

View File

@ -215,7 +215,7 @@
// update rating (if correct logtype, user has ratings to give and is not owner (exept owner adopted cache))
if ($rateOption && $user->allowRatings() && (!$isOwner || ($isOwner && $cache->hasAdopted($user->getUserId()))))
if ($rateCache)
$cache->addRecommendation($user->getUserId());
$cache->addRecommendation($user->getUserId(), $logDate);
else
$cache->removeRecommendation($user->getUserId());