Exemplo n.º 1
0
 public function getUserCount()
 {
     $standings = new IntroImageStandingsIndividual();
     $data = $standings->fetchStats();
     return $data['week'];
 }
    /**
     * EXECUTE
     **/
    function execute($par)
    {
        global $wgRequest, $wgOut, $wgUser, $wgLang;
        $fname = "Introimageadder::execute";
        wfProfileIn($fname);
        $target = isset($par) ? $par : $wgRequest->getVal('target');
        $wgOut->addHTML('<center><tt><b>
Dear intro image adder,<br>
<br>
We had some good days together, we had some bad days together. At this point, I think<br>
we\'ve outgrown each other. It\'s time for us to break up.<br>
<br>
Love, <a href="http://forums.wikihow.com/discussion/6321/retiring-the-intro-image-adder">wikiHow</a><br>
		</b></tt></center>');
        return;
        if ($wgUser->isBlocked()) {
            $wgOut->blockedPage();
            wfProfileOut($fname);
            return;
        }
        if ($wgUser->getID() == 0) {
            $wgOut->setRobotpolicy('noindex,nofollow');
            $wgOut->showErrorPage('nosuchspecialpage', 'nospecialpagetext');
            wfProfileOut($fname);
            return;
        }
        //XXNOTE Temporary push to prod code.  When released, remove admin requirement
        //
        //if ( !in_array( 'newarticlepatrol', $wgUser->getRights() ) ) {
        //	$wgOut->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
        //	rreturn;
        //}
        if ($wgRequest->getVal('fetchArticle')) {
            $wgOut->setArticleBodyOnly(true);
            echo json_encode($this->fetchArticle());
            wfProfileOut($fname);
            return;
        } else {
            if ($wgRequest->getVal('confirmation')) {
                $wgOut->setArticleBodyOnly(true);
                echo $this->confirmationModal($wgRequest->getVal('iiatitle'), $wgRequest->getVal('imgtag'));
                wfProfileOut($fname);
                return;
            } else {
                if ($wgRequest->getVal('fetchMessage')) {
                    $wgOut->setArticleBodyOnly(true);
                    echo json_encode($this->fetchMessage());
                    wfProfileOut($fname);
                    return;
                }
            }
        }
        $wgOut->setHTMLTitle('Intro Image Adder - wikiHow');
        $indi = new IntroImageStandingsIndividual();
        $indi->addStatsWidget();
        $standings = new IntroImageStandingsGroup();
        $standings->addStandingsWidget();
        $this->show();
        wfProfileOut($fname);
        return;
    }