Example #1
0
 public function getCount(&$dbr)
 {
     return NFDGuardian::getUnfinishedCount($dbr);
 }
<?php

/*
 * Imports articles that have a NFD template on them. Checks
 * to see if they already exist in the NFD table.
 */
global $IP;
require_once 'commandLine.inc';
require_once "{$IP}/extensions/wikihow/nfd/NFDGuardian.body.php";
NFDGuardian::importNFDArticles();
NFDGuardian::checkArticlesInNfdTable();
 /**
  *
  * Returns the text for the all the votes listed
  * in the info section.
  *
  */
 function getTotalVotes($nfd_id)
 {
     $dbr = wfGetDB(DB_SLAVE);
     $keeps = array();
     $deletes = array();
     $admin = true;
     NFDGuardian::getDeleteKeep($deletes, $keeps, $nfd_id);
     $html = "";
     if (count($deletes) == 0 && count($keeps) == 0) {
         $html .= "There have been no votes yet.";
     } else {
         if (count($deletes) > 0) {
             $i = 0;
             foreach ($deletes as $delete) {
                 if ($i > 0) {
                     $html .= ", ";
                 }
                 $html .= NFDGuardian::getUserInfo($delete);
                 $i++;
             }
             $html .= " voted to delete. ";
         } else {
             $html .= "There have been no votes to delete. ";
         }
         if (count($keeps) > 0) {
             $i = 0;
             foreach ($keeps as $keep) {
                 if ($i > 0) {
                     $html .= ", ";
                 }
                 $html .= NFDGuardian::getUserInfo($keep);
                 $i++;
             }
             $html .= " voted to keep. ";
         } else {
             $html .= "There have been no votes to keep. ";
         }
     }
     return $html;
 }