-a --all All users
END_OF_SILENCESPAMMER_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
function testAllUsers($filter, $minimum, $percent) {
$found = false;
printfnq("Testing user %s\n", $user->nickname);
- $profile = Profile::staticGet('id', $user->id);
+ $profile = Profile::getKV('id', $user->id);
if ($profile->isSilenced()) {
printfnq("Already silenced %s\n", $user->nickname);
$ss->query(sprintf("SELECT count(*) as spam_count ".
"FROM notice join spam_score on notice.id = spam_score.notice_id ".
- "WHERE notice.profile_id = %d", $profile->id));
+ "WHERE notice.profile_id = %d AND spam_score.is_spam = 1", $profile->id));
while ($ss->fetch()) {
$spam_count = $ss->spam_count;