/** * Get a list of users, who want to suggest to edit this article. ' * @param $title Title object for the article * @param minUserScore The minimum bytes a user needs to have added to an article for us to consider them as having contributed to that article */ function getSuggestedUsers($title, $minUserScore = 200) { if (!$title || !$title->getText()) { return array(); } $relatedTitles = DedupQuery::getRelated($title, 3); $userScore = array(); foreach ($relatedTitles as $t) { if ($t['title']->getArticleId() == $title->getArticleId()) { continue; } if (in_array($t['title']->getArticleId(), $this->_relatedExcludes)) { continue; } $se = SuccessfulEdit::getEdits($t['title']->getArticleId()); $userScore2 = array(); foreach ($se as $e) { if (!isset($userScore2[$e['username']])) { $userScore2[$e['username']] = 0; } $userScore2[$e['username']] += $e['added']; } foreach ($userScore2 as $username => $score) { if ($score > $minUserScore) { $userScore[$username] = $score * $t['ct']; $this->_userArticles[$username][$title->getArticleId()] += $score * $t['ct']; $this->_userArticleRelated[$username][$title->getArticleId()][$t['title']->getArticleId()] = 1; } } } return $userScore; }