private function displayNABConsole(&$dbw, &$dbr, $target)
    {
        global $wgOut, $wgRequest, $wgUser, $wgParser;
        $not_found = false;
        $title = Title::newFromURL($target);
        if (!$title || !$title->exists()) {
            $articleName = $title ? $title->getFullText() : $target;
            $wgOut->addHTML("<p>Error: Article &ldquo;{$articleName}&rdquo; not found. Return to <a href='/Special:Newarticleboost'>New Article Boost</a> instead.</p>");
            $not_found = true;
        }
        if (!$not_found) {
            $rev = Revision::newFromTitle($title);
            if (!$rev) {
                $wgOut->addHTML("<p>Error: No revision for &ldquo;{$title->getFullText()}&rdquo;. Return to <a href='/Special:Newarticleboost'>New Article Boost</a> instead.</p>");
                $not_found = true;
            }
        }
        if (!$not_found) {
            $in_nab = $dbr->selectField('newarticlepatrol', 'count(*)', array('nap_page' => $title->getArticleID()), __METHOD__) > 0;
            if (!$in_nab) {
                $wgOut->addHTML("<p>Error: This article is not in the NAB list.</p>");
                $not_found = true;
            }
        }
        if ($not_found) {
            $pageid = $wgRequest->getVal('page');
            if (strpos($target, ':') !== false && $pageid) {
                $wgOut->addHTML('<p>We can to try to <a href="/Special:NABClean/' . $pageid . '">delete this title</a> if you know this title exists in NAB yet is likely bad data.</p>');
            }
            return;
        }
        $locked = false;
        $min_timestamp = $dbr->selectField("revision", "min(rev_timestamp)", "rev_page=" . $title->getArticleId(), __METHOD__);
        $first_user = $dbr->selectField("revision", "rev_user_text", array("rev_page=" . $title->getArticleId(), 'rev_timestamp' => $min_timestamp), __METHOD__);
        $first_user_id = $dbr->selectField("revision", "rev_user", array("rev_page=" . $title->getArticleId(), 'rev_timestamp' => $min_timestamp), __METHOD__);
        $user = new User();
        if ($first_user_id) {
            $user->setId($first_user_id);
            $user->loadFromDatabase();
        } else {
            $user->setName($first_user);
        }
        $user_talk = $user->getTalkPage();
        $ut_id = $user_talk->getArticleID();
        $display_name = $user->getRealName() ? $user->getRealName() : $user->getName();
        $wgOut->setPageTitle(wfMsg('nap_title', $title->getFullText()));
        $count = $dbr->selectField('suggested_titles', array('count(*)'), array('st_title' => $title->getDBKey()), __METHOD__);
        $extra = $count > 0 ? ' - from Suggested Titles database' : '';
        $wgOut->addWikiText(wfMsg('nap_writtenby', $user->getName(), $display_name, $extra));
        $wgOut->addHTML(wfMsgExt('nap_quicklinks', 'parseinline', $this->me->getFullText() . "/" . $title->getFullText()));
        /// CHECK TO SEE IF ARTICLE IS LOCKED OR ALREADY PATROLLED
        $aid = $title->getArticleID();
        $half_hour_ago = wfTimestamp(TS_MW, time() - 30 * 60);
        $patrolled = $dbr->selectField('newarticlepatrol', 'nap_patrolled', array("nap_page={$aid}"), __METHOD__);
        if ($patrolled) {
            $locked = true;
            $wgOut->addHTML(wfMsgExt("nap_patrolled", 'parse'));
        } else {
            $user_co = $dbr->selectField('newarticlepatrol', 'nap_user_co', array("nap_page={$aid}", "nap_timestamp_co > '{$half_hour_ago}'"), __METHOD__);
            if ($user_co != '' && $user_co != 0 && $user_co != $wgUser->getId()) {
                $x = User::newFromId($user_co);
                $wgOut->addHTML(wfMsgExt("nap_usercheckedout", 'parse', $x->getName()));
                $locked = true;
            } else {
                // CHECK OUT THE ARTICLE TO THIS USER
                $ts = wfTimestampNow();
                $dbw->update('newarticlepatrol', array('nap_timestamp_co' => $ts, 'nap_user_co' => $wgUser->getId()), array("nap_page = {$aid}"), __METHOD__);
            }
        }
        $expandSpan = '<span class="nap_expand">&#9660;</span>';
        $externalLinkImg = '<img src="' . wfGetPad('/skins/common/images/external.png') . '"/>';
        /// SIMILAR RESULT
        $wgOut->addHTML("<div class='nap_section minor_section'>");
        $wgOut->addHTML("<h2 class='nap_header'>{$expandSpan} " . wfMsg('nap_similarresults') . "</h2>");
        $wgOut->addHTML("<div class='nap_body section_text'>");
        $count = 0;
        $l = new LSearch();
        $hits = $l->googleSearchResultTitles($title->getFullText(), 0, 5);
        if (sizeof($hits) > 0) {
            $html = "";
            foreach ($hits as $hit) {
                $t1 = $hit;
                $id = rand(0, 500);
                if ($t1 == null || $t1->getFullURL() == $title->getFullURL() || $t1->getNamespace() != NS_MAIN || !$t1->exists()) {
                    continue;
                }
                $safe_title = htmlspecialchars(str_replace("'", "&#39;", $t1->getText()));
                $html .= "<tr><td>" . $this->skin->makeLinkObj($t1, wfMsg('howto', $t1->getText())) . "</td><td style='text-align:right; width: 200px;'>[<a href='#action' onclick='nap_Merge(\"{$safe_title}\");'>" . wfMsg('nap_merge') . "</a>] " . " [<a href='#action' onclick='javascript:nap_Dupe(\"{$safe_title}\");'>" . wfMsg('nap_duplicate') . "</a>] " . " <span id='mr_{$id}'>[<a onclick='javascript:nap_MarkRelated({$id}, {$t1->getArticleID()}, {$title->getArticleID()});'>" . wfMsg('nap_related') . "</a>]</span> " . "</td></tr>";
                $count++;
            }
        }
        if ($count == 0) {
            $wgOut->addHTML(wfMsg('nap_no-related-topics'));
        } else {
            $wgOut->addHTML(wfMsg('nap_already-related-topics') . "<table style='width:100%;'>{$html}</table>");
        }
        $wgOut->addHTML(wfMsg('nap_othersearches', urlencode($title->getFullText())));
        $wgOut->addHTML("</div>");
        $wgOut->addHTML("</div>");
        /// COPYRIGHT CHECKER
        $cc_check = SpecialPage::getTitleFor('Copyrightchecker', $title->getText());
        $wgOut->addHTML("<script type='text/javascript'>window.onload = nap_cCheck; var nap_cc_url = \"{$cc_check->getFullURL()}\";</script>");
        $wgOut->addHTML("<div class='nap_section minor_section'>");
        $wgOut->addHTML("<h2 class='nap_header'>{$expandSpan} " . wfMsg('nap_copyrightchecker') . "</h2>");
        $wgOut->addHTML("<div class='nap_body section_text'>");
        $wgOut->addHTML("<div id='nap_copyrightresults'><center><img src='/extensions/wikihow/rotate.gif' alt='loading...'/></center></div>");
        $wgOut->addHTML("<center><input type='button' class='button primary' onclick='nap_cCheck();' value='Check'/></center>");
        $wgOut->addHTML("</div>");
        $wgOut->addHTML("</div>");
        /// ARTICLE PREVIEW
        $editUrl = Title::makeTitle(NS_SPECIAL, "QuickEdit")->getFullURL() . "?type=editform&target=" . urlencode($title->getFullText()) . "&fromnab=1";
        $wgOut->addHTML("<div class='nap_section minor_section'>");
        $wgOut->addHTML("<a name='article' id='anchor-article'></a>");
        $wgOut->addHTML("<h2 class='nap_header'>{$expandSpan} " . wfMsg('nap_articlepreview') . " - <a href=\"{$title->getFullURL()}\" target=\"new\">" . wfMsg('nap_articlelinktext') . "</a> {$externalLinkImg}" . " - <a href=\"{$title->getEditURL()}\" target=\"new\">" . wfMsg('edit') . "</a> {$externalLinkImg}" . " - <a href=\"{$title->getFullURL()}?action=history\" target=\"new\">" . wfMsg('history') . "</a> {$externalLinkImg}" . " - <a href=\"{$title->getTalkPage()->getFullURL()}\" target=\"new\">" . wfMsg('discuss') . "</a> {$externalLinkImg}" . "</h2>");
        $wgOut->addHTML("<div class='nap_body section_text'>");
        $wgOut->addHTML("<div id='article_contents' ondblclick='nap_editClick(\"{$editUrl}\");'>");
        $popts = $wgOut->parserOptions();
        $popts->setTidy(true);
        // $parserOutput = $wgOut->parse($rev->getText(), $title, $popts);
        $output = $wgParser->parse($rev->getText(), $title, $popts);
        $parserOutput = $output->getText();
        $magic = WikihowArticleHTML::grabTheMagic($rev->getText());
        $html = WikihowArticleHTML::processArticleHTML($parserOutput, array('no-ads' => true, 'ns' => $title->getNamespace(), 'magic-word' => $magic));
        $wgOut->addHTML($html);
        $wgOut->addHTML("</div>");
        $wgOut->addHTML("<center><input id='editButton' type='button' class='button primary' name='wpEdit' value='" . wfMsg('edit') . "' onclick='nap_editClick(\"{$editUrl}\");'/></center>");
        $wgOut->addHTML("</div>");
        $wgOut->addHTML("</div>");
        $wgOut->addHTML('<div style="clear: both;"></div>');
        /// DISCUSSION PREVIEW
        $talkPage = $title->getTalkPage();
        $wgOut->addHTML("<div class='nap_section minor_section'>");
        $wgOut->addHTML("<a name='talk' id='anchor-talk'></a>");
        $wgOut->addHTML("<h2 class='nap_header'>{$expandSpan} " . wfMsg('nap_discussion') . " - <a href=\"{$talkPage->getFullURL()}\" target=\"new\">" . wfMsg('nap_articlelinktext') . "</a> {$externalLinkImg}" . "</h2>");
        $wgOut->addHTML("<div class='nap_body section_text'>");
        $wgOut->addHTML("<div id='disc_page'>");
        if ($talkPage->getArticleID() > 0) {
            $rp = Revision::newFromTitle($talkPage);
            $wgOut->addHTML($wgOut->parse($rp->getText()));
        } else {
            $wgOut->addHTML(wfMsg('nap_discussionnocontent'));
        }
        $wgOut->addHTML(PostComment::getForm(true, $talkPage, true));
        $wgOut->addHTML("</div>");
        $wgOut->addHTML("</div>");
        $wgOut->addHTML("</div>");
        /// USER INFORMATION
        $wgOut->addHTML("<div class='nap_section minor_section'>");
        $wgOut->addHTML("<a name='user' id='anchor-user'></a>");
        $used_templates = array();
        if ($ut_id > 0) {
            $res = $dbr->select('templatelinks', array('tl_title'), array('tl_from=' . $ut_id), __METHOD__);
            while ($row = $dbr->fetchObject($res)) {
                $used_templates[] = strtolower($row->tl_title);
            }
            $dbr->freeResult($res);
        }
        $wgOut->addHTML("<h2 class='nap_header'>{$expandSpan} " . wfMsg('nap_userinfo') . " - <a href=\"{$user_talk->getFullURL()}\" target=\"new\">" . wfMsg('nap_articlelinktext') . "</a> {$externalLinkImg}" . "</h2>");
        $wgOut->addHTML("<div class='nap_body section_text'>");
        $contribs = SpecialPage::getTitleFor('Contributions', $user->getName());
        $regDateTxt = "";
        if ($user->getRegistration() > 0) {
            preg_match('/^(\\d{4})(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)$/D', $user->getRegistration(), $da);
            $uts = gmmktime((int) $da[4], (int) $da[5], (int) $da[6], (int) $da[2], (int) $da[3], (int) $da[1]);
            $regdate = gmdate('F j, Y', $uts);
            $regDateTxt = wfMsg('nap_regdatetext', $regdate) . ' ';
        }
        $key = 'nap_userinfodetails_anon';
        if ($user->getID() != 0) {
            $key = 'nap_userinfodetails';
        }
        $wgOut->addWikiText(wfMsg($key, $user->getName(), number_format(WikihowUser::getAuthorStats($first_user), 0, "", ","), $title->getFullText(), $regDateTxt));
        if (WikihowUser::getAuthorStats($first_user) < 50) {
            if ($user_talk->getArticleId() == 0) {
                $wgOut->addHTML(wfMsg('nap_newwithouttalkpage'));
            } else {
                $rp = Revision::newFromTitle($user_talk);
                $xtra = "";
                if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE 8.0") === false) {
                    $xtra = "max-height: 300px; overflow: scroll;";
                }
                $output = $wgParser->parse($rp->getText(), $user_talk, $popts);
                $parserOutput = $output->getText();
                $wgOut->addHTML("<div style='border: 1px solid #eee; {$xtra}'>" . $parserOutput . "</div>");
            }
        }
        if ($user_talk->getArticleId() != 0 && sizeof($used_templates) > 0) {
            $wgOut->addHTML('<br />' . wfMsg('nap_usertalktemplates', implode($used_templates, ", ")));
        }
        $wgOut->addHTML(PostComment::getForm(true, $user_talk, true));
        $wgOut->addHTML("</div>");
        $wgOut->addHTML("</div>");
        /// ACTION INFORMATION
        $maxrcid = $dbr->selectField('recentchanges', 'max(rc_id)', array('rc_cur_id=' . $aid), __METHOD__);
        $wgOut->addHTML("<div class='nap_section minor_section'>");
        $wgOut->addHTML("<a name='action' id='anchor-action'></a>");
        $wgOut->addHTML("<h2 class='nap_header'> " . wfMsg('nap_action') . "</h2>");
        $wgOut->addHTML("<div class='nap_body section_text'>");
        $wgOut->addHTML("<form action='{$this->me->getFullURL()}' name='nap_form' method='post' onsubmit='return checkNap();'>");
        $wgOut->addHTML("<input type='hidden' name='target' value='" . htmlspecialchars($title->getText()) . "'/>");
        $wgOut->addHTML("<input type='hidden' name='page' value='{$aid}'/>");
        $wgOut->addHTML("<input type='hidden' name='newbie' value='" . $wgRequest->getVal('newbie', 0) . "'/>");
        $wgOut->addHTML("<input type='hidden' name='prevuser' value='" . $user->getName() . "'/>");
        $wgOut->addHTML("<input type='hidden' name='maxrcid' value='{$maxrcid}'/>");
        $wgOut->addHTML("<table>");
        $suggested = $dbr->selectField('suggested_titles', 'count(*)', array('st_title' => $title->getDBKey()), __METHOD__);
        if ($suggested > 0) {
            $wgOut->addHTML("<tr><td valign='top'>" . wfMsg('nap_suggested_warning') . "</td></tr>");
        }
        $wgOut->addHTML("</table>");
        $wgOut->addHTML(wfMsg('nap_actiontemplates'));
        if ($wgUser->isAllowed('delete') || $wgUser->isAllowed('move')) {
            $wgOut->addHTML(wfMsg('nap_actionmovedeleteheader'));
            if ($wgUser->isAllowed('move')) {
                $wgOut->addHTML(wfMsg('nap_actionmove', htmlspecialchars($title->getText())));
            }
            if ($wgUser->isAllowed('delete')) {
                $wgOut->addHTML(wfMsg('nap_actiondelete'));
            }
        }
        // BUTTONS
        $wgOut->addHTML("<input type='submit' value='" . wfMsg('nap_skip') . "' id='nap_skip' name='nap_skip' class='button secondary' />");
        if (!$locked) {
            $wgOut->addHTML("<input type='submit' value='" . wfMsg('nap_markaspatrolled') . "' id='nap_submit' name='nap_submit' class='button primary' />");
        }
        $wgOut->addHTML("</form>");
        $wgOut->addHTML("</div>");
        $wgOut->addHTML("</div>");
        $wgOut->addHTML(<<<END
<script type='text/javascript'>

var tabindex = 1;
for(i = 0; i < document.forms.length; i++) {
\tfor (j = 0; j < document.forms[i].elements.length; j++) {
\t\tswitch (document.forms[i].elements[j].type) {
\t\t\tcase 'submit':
\t\t\tcase 'text':
\t\t\tcase 'textarea':
\t\t\tcase 'checkbox':
\t\t\tcase 'button':
\t\t\t\tdocument.forms[i].elements[j].tabIndex = tabindex++;
\t\t\t\tbreak;
\t\t\tdefault:
\t\t\t\tbreak;
\t\t}
\t}
}

// Handlers for expand/contract arrows
(function (\$) {
\$('.nap_expand').click(function() {
\tvar thisSpan = \$(this);
\tvar body = thisSpan.parent().next();
\tvar footer = body.next();
\tif (body.css('display') != 'none') {
\t\tfooter.hide();
\t\tbody.css('overflow', 'hidden');
\t\tvar oldHeight = body.height();
\t\tbody.animate(
\t\t\t{ height: 0 },
\t\t\t200,
\t\t\t'swing',
\t\t\tfunction () {
\t\t\t\tthisSpan.html('&#9658;');
\t\t\t\tbody
\t\t\t\t\t.hide()
\t\t\t\t\t.height(oldHeight);
\t\t\t});
\t} else {
\t\tvar oldHeight = body.height();
\t\tbody.height(0);
\t\tbody.animate(
\t\t\t{ height: oldHeight },
\t\t\t200,
\t\t\t'swing',
\t\t\tfunction () {
\t\t\t\tthisSpan.html('&#9660;');
\t\t\t\tfooter.show();
\t\t\t\tbody.css('overflow', 'visible');
\t\t\t});
\t}
\treturn false;
});
})(jQuery);

</script>

END
);
    }
Example #2
0
 function getContributions()
 {
     global $wgTitle, $wgUser;
     $user = $this->user;
     $username = $user->getName();
     $real_name = User::whoIsReal($user->getId());
     $real_name = $real_name ? $real_name : $username;
     $contribsPage = SpecialPage::getTitleFor('Contributions', $username);
     $isLoggedIn = $wgUser && $wgUser->getID() > 0;
     $userstats = "<div id='userstats'>";
     if ($user && $user->getID() > 0) {
         $editsMade = number_format(WikihowUser::getAuthorStats($username), 0, "", ",");
         if ($isLoggedIn) {
             $userstats .= wfMsg('contributions-made', $real_name, $editsMade, $contribsPage->getFullURL());
         } else {
             $userstats .= wfMsg('contributions-made-anon', $real_name, $editsMade);
         }
     } else {
         // showing an anon user page
         if ($isLoggedIn) {
             $link = '<a href="' . $contribsPage->getFullURL() . '">' . $wgTitle->getText() . '</a>';
             $userstats .= wfMsg('contributions-link', $link);
         }
     }
     $userstats .= "</div>";
     return $userstats;
 }
Example #3
0
 function getQuickNoteLink($title, $userId, $userText, $editor = null)
 {
     if (!$editor) {
         $editor = User::newFromId($userId);
         $editor->loadFromId();
     }
     $regdate = $editor->getRegistration();
     if ($regdate != "") {
         $ts = wfTimestamp(TS_UNIX, $regdate);
         $regdate = date('M j, Y', $ts);
     }
     $contrib = number_format(WikihowUser::getAuthorStats($userText), 0, "", ",");
     return "<a href='' id='qn_button' onclick=\"return initQuickNote('" . urlencode($title->getPrefixedText()) . "','" . $userText . "','" . $contrib . "','" . $regdate . "') ;\">quick note</a>";
 }
 function showArticlesPage($page, $period, $starttimestamp, $user)
 {
     global $wgOut, $wgUser;
     $wgOut->addHTML("  <style type='text/css' media='all'>/*<![CDATA[*/ @import '" . wfGetPad('/extensions/min/f/extensions/wikihow/Leaderboard.css?rev=') . WH_SITEREV . "'; /*]]>*/</style>\n\t\t\t<script type='text/javascript' src='" . wfGetPad('/extensions/min/f/extensions/wikihow/Leaderboard.js?rev=') . WH_SITEREV . "'></script>");
     $wgOut->addHTML("  <script type='text/javascript'>\n\t\t\t\tvar lb_page = '{$target}';\n\t\t\t\tvar lb_period = '{$period}';\n\t\t\t</script>\n");
     //$wgOut->addHTML(" TEST: $page $starttimestamp $user <br/>\n");
     $data = array();
     $subtitle = '';
     switch ($page) {
         case 'articles_written':
             $data = $this->getArticlesWritten($starttimestamp, $user, true);
             $subtitle = 'Articles Written by ';
             break;
         case 'risingstars_received':
             $data = $this->getRisingStar($starttimestamp, $user, true);
             $subtitle = 'Articles that received a Risingstar by ';
             break;
         case 'requested_topics':
             $data = $this->getRequestedTopics($starttimestamp, $user, true);
             $subtitle = 'Articles from requested topics by ';
             break;
         case 'articles_nabed':
             $data = $this->getArticlesNABed($starttimestamp, $user, true);
             $subtitle = 'New Articles Boosted by ';
             break;
         case 'risingstars_nabed':
             $data = $this->getRisingStarsNABed($starttimestamp, $user, true);
             $subtitle = 'New Articles nominated for Risingstar by ';
             break;
         case 'rc_edits':
             $data = $this->getRCEdits($starttimestamp, $user, true);
             $subtitle = 'Articles Patrolled - ';
             break;
         case 'rc_quick_edits':
             $data = $this->getRCQuickEdits($starttimestamp, $user, true);
             $subtitle = 'Quick Edits made while patrolling - ';
             break;
         case 'total_edits':
             $data = $this->getTotalEdits($starttimestamp, $user, true);
             $subtitle = 'Total Edits - ';
             break;
         case 'articles_categorized':
             $data = $this->getArticlesCategorized($starttimestamp, $user, true);
             $subtitle = 'Articles Categorized - ';
             break;
         case 'images_added':
             $data = $this->getImagesAdded($starttimestamp, $user, true);
             $subtitle = 'Images Added - ';
             break;
         case 'videos_reviewed':
             $data = $this->getVideosReviewed($starttimestamp, $user, true);
             $subtitle = 'Videos Added - ';
             break;
         case 'repair_format':
             $data = $this->getArticlesRepaired($starttimestamp, 'format', $user, true);
             $subtitle = 'Formats Fixed - ';
             break;
         case 'repair_stub':
             $data = $this->getArticlesRepaired($starttimestamp, 'stub', $user, true);
             $subtitle = 'Stubs Fixed - ';
             break;
         case 'repair_topic':
             $data = $this->getArticlesRepaired($starttimestamp, 'topic', $user, true);
             $subtitle = 'Fixed by Topic - ';
             break;
         case 'repair_copyedit':
             $data = $this->getArticlesRepaired($starttimestamp, 'copyedit', $user, true);
             $subtitle = 'Copyedit Fixed - ';
             break;
         case 'repair_cleanup':
             $data = $this->getArticlesRepaired($starttimestamp, 'cleanup', $user, true);
             $subtitle = 'Cleanup Fixed - ';
             break;
         case 'nfd':
             $data = $this->getNfdsReviewed($starttimestamp, $user, true);
             $subtitle = 'NFDs Reviewed - ';
             break;
         case 'spellchecked':
             $data = $this->getSpellchecked($starttimestamp, $user, true);
             $subtitle = 'Articles Spell Checked - ';
             break;
         case 'methodguardian':
             $data = $this->getMethodGuardian($starttimestamp, $user, true);
             $subtitle = 'Methods Guarded - ';
             break;
         case 'methodeditor':
             $data = $this->getMethodEditor($starttimestamp, $user, true);
             $subtitle = 'Methods Edited - ';
             break;
         case 'welcomewagon':
             $data = $this->getWelcomeWagon($starttimestamp, $user, true);
             $subtitle = 'Welcome Wagon Messages Sent - ';
             break;
         default:
             return;
     }
     switch ($period) {
         case 7:
             $subtitle .= $user . " in the last week";
             break;
         case 31:
             $subtitle .= $user . " in the last month";
             break;
         default:
             $subtitle .= $user . " in the last day";
             break;
     }
     $sk = $wgUser->getSkin();
     $u = User::newFromName($user);
     if (isset($u)) {
         $u->load();
     }
     $userlink = $sk->makeLinkObj($u->getUserPage(), $u->getName());
     $regdate = "Jan 1, 1970";
     if ($u->getRegistration() != '') {
         $regdate = gmdate('M d, Y', wfTimestamp(TS_UNIX, $u->getRegistration()));
     } else {
         $regdate = gmdate('M d, Y', wfTimestamp(TS_UNIX, '20060725043938'));
     }
     $contributions = number_format(WikihowUser::getAuthorStats($u->getName()), 0, "", ",");
     $contribsPage = SpecialPage::getTitleFor('Contributions', $user);
     $contriblink = $sk->makeLinkObj($contribsPage, 'contrib');
     $talkpagelink = $sk->makeLinkObj($u->getTalkPage(), 'talk');
     $otherlinks = "({$contriblink} | {$talkpagelink})";
     $wgOut->addHTML("\n<div id='Leaderboard'>\n");
     $wgOut->addHTML("<br />{$subtitle}<br/>\n\t\t\t" . wfMsg('leaderboard_articlespage_msg', $userlink, $regdate, $contributions, $otherlinks) . "<br/>\n\t\t\t\n");
     $wgOut->addHTML("<table class='leader_table' style='width:475px; margin:0 auto;'>");
     $index = 1;
     $wgOut->addHTML("<tr>\n\t\t\t<td class='leader_title'>Article</td>\n\t\t\t</tr>\n\t\t");
     $index = 1;
     foreach ($data as $key => $value) {
         $class = "";
         if ($index % 2 == 1) {
             $class = 'class="odd"';
         }
         $t = Title::newFromText($value);
         if ($page == 'images_added_NOT_SETUP_YET') {
             //In the future we can display the actual image added on this page.
             $wgOut->addHTML("<tr {$class}><td style='text-align:left;'><img src='/{$key}' /><a href='/{$key}' >{$value}</a></td</tr>\n");
         } else {
             if ($page == 'welcomewagon') {
                 $wgOut->addHTML("<tr><td class='leader_image'><a href='/{$key}' >{$value}</a></td</tr>\n");
             } else {
                 $wgOut->addHTML("<tr><td class='leader_image'><a href='/{$key}' >{$value}</a> (<a href='" . $t->getLocalURL('action=history') . "' >history</a>)</td</tr>\n");
             }
         }
         $index++;
     }
     $wgOut->addHTML("</table></center>");
     $wgOut->addHTML("<br /><a href='/Special:Leaderboard/{$page}?period={$period}' >Back</a></div>\n");
     return;
 }
 /**
  * Retrieve number of edits by a user
  */
 private function numEdits()
 {
     if ($this->title->getNamespace() != NS_USER) {
         return 0;
     }
     $u = explode("/", $this->title->getText());
     return WikihowUser::getAuthorStats($u[0]);
 }