drop usage of holidayIds (as far as possible)
  the obvious change is, that all events are now refenreced by a positive eventId.
  (?event=375 will probably become ?event=5)
Comments
  fixed malformed db-table. It can now hold negative typeIds.
  applying this commit will drop any comments related to events without holiday
  added gain of SiteReputation for comment-replies

resyncing dependencies of 'game_event' is required
This commit is contained in:
Sarjuuk
2015-07-11 23:59:55 +02:00
parent e9399c169a
commit 051334da22
22 changed files with 171 additions and 105 deletions

View File

@@ -575,6 +575,10 @@ class AjaxHandler
if (!$this->post('id') || !User::canUpvote())
break;
$owner = DB::Aowow()->selectCell('SELECT userId FROM ?_comments WHERE id = ?d', $this->post('id'));
if (!$owner)
break;
$ok = DB::Aowow()->query(
'INSERT INTO ?_comments_rates (commentId, userId, value) VALUES (?d, ?d, ?d)',
$this->post('id'),
@@ -583,13 +587,20 @@ class AjaxHandler
);
if ($ok)
{
Util::gainSiteReputation($owner, SITEREP_ACTION_UPVOTED, ['id' => $this->post('id'), 'voterId' => User::$id]);
User::decrementDailyVotes();
}
break;
case 'downvote-reply':
if (!$this->post('id') || !User::canUpvote())
break;
$owner = DB::Aowow()->selectCell('SELECT userId FROM ?_comments WHERE id = ?d', $this->post('id'));
if (!$owner)
break;
$ok = DB::Aowow()->query(
'INSERT INTO ?_comments_rates (commentId, userId, value) VALUES (?d, ?d, ?d)',
$this->post('id'),
@@ -598,7 +609,10 @@ class AjaxHandler
);
if ($ok)
{
Util::gainSiteReputation($owner, SITEREP_ACTION_DOWNVOTED, ['id' => $this->post('id'), 'voterId' => User::$id]);
User::decrementDailyVotes();
}
}
return json_encode($result, JSON_NUMERIC_CHECK);