mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Events
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user