Skip to content

Commit

Permalink
Favoriting your own notices to get on popular is cheating
Browse files Browse the repository at this point in the history
  • Loading branch information
RedEnchilada committed Apr 25, 2014
1 parent dc5c744 commit 1c0610f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/popularity.php
Expand Up @@ -68,10 +68,10 @@ function getNotices()
$qry = "SELECT notice.*, $weightexpr as weight ";
if(isset($tag)) {
$qry .= 'FROM notice_tag, notice JOIN fave ON notice.id = fave.notice_id ' .
"WHERE $cutoff and notice.id = notice_tag.notice_id and '$tag' = notice_tag.tag";
"WHERE $cutoff and fave.user_id != notice.profile_id and notice.id = notice_tag.notice_id and '$tag' = notice_tag.tag";
} else {
$qry .= 'FROM notice JOIN fave ON notice.id = fave.notice_id ' .
"WHERE $cutoff";
"WHERE $cutoff and fave.user_id != notice.profile_id";
}
if(isset($this->user)) {
$qry .= " AND profile_id={$this->user->id}";
Expand Down

0 comments on commit 1c0610f

Please sign in to comment.