Ejemplo n.º 1
0
     ########
     $isBlocked = $script->currently_blocked();
     $script->condition(!$isBlocked, "not blocked...", $blockMessage, "", $blockClass);
     if ($isBlocked) {
         $blockCount++;
         $blockClass = "";
         $blockMessage = $blockMessageMultiple;
     }
     ########
     ## Not a bot
     ########
     $script->condition(!$script->has_role('bot'), "no bot flag...", "has a bot flag: this account is not eligible.", "", "is-fail");
     ########
     ## >=300 edits before 2015-04-15
     ########
     $edits = $script->edit_count(NULL, 20150415235959.0);
     $script->condition($edits >= 300, "has 300 edits before 15 April 2015 (has {$edits})...", "does not have 300 edits before 15 April 2015 (has {$edits}); edits can be combined across wikis.", "", "is-warn");
     $editCount += $edits;
     ########
     ## >=20 edits between 2014-10-15 and 2015-04-15
     ########
     $edits = $script->edit_count(20141015000000.0, 20150415235959.0);
     $script->condition($edits >= 20, "has 20 edits between 15 October 2014 and 15 April 2015 (has {$edits})...", "does not have 20 edits between 15 October 2014 and 15 April 2015 (has {$edits}); edits can be combined across wikis.", "", "is-warn");
     $editCountRecent += $edits;
     ########
     ## Exit conditions
     ########
     $script->eligible = $blockCount <= 1 && $editCount >= 300 && $editCountRecent >= 20;
 } while (!$script->eligible && $script->get_next());
 break;
 ############################