function ListPages($input) { require_once 'ListPagesClass.php'; //purgePage(); $details = 1; getValue($ctg, $input, "category"); getValue($count, $input, "count"); getValue($order, $input, "sort"); getValue($orderMethod, $input, "order"); getValue($level, $input, "level"); getValue($details, $input, "details"); getValue($showpub, $input, "published"); getValue($showuser, $input, "showuser"); getValue($random, $input, "random"); getValue($nav, $input, "nav"); getValue($showctg, $input, "showcategories"); getValue($showpic, $input, "showpicture"); getValue($showblurb, $input, "showblurb"); getValue($blurbfontsize, $input, "blurbfontsize"); getValue($cache, $input, "cache"); getValue($showRating, $input, "rating"); getValue($date, $input, "showdate"); getValue($stats, $input, "showstats"); getValue($votebox, $input, "votebox"); getValue($ratingMin, $input, "rating minimum"); if (strpos(strtoupper($details), "VOTEBOXTITLE") !== false) { $list = new ListPagesView(); } else { $list = new ListPages(); } $list->setCategory($ctg); $list->setShowCount($count); $list->setPageNo(1); $list->setSortBy($order); $list->setOrder($orderMethod); $list->setLevel($level); $list->setShowDetails($details); $list->setShowPublished($showpub); $list->setShowBlurb($showblurb); $list->setBlurbFontSize($blurbfontsize); $list->setHash($input); $list->setRatingMin($ratingMin); $list->setBool("ShowUser", $showuser); $list->setBool("ShowNav", $nav); $list->setBool("random", $random); $list->setBool("ShowCtg", $showctg); $list->setBool("ShowPic", $showpic); $list->setBool("ShowRating", $showRating); $list->setBool("ShowDate", $date); $list->setBool("ShowStats", $stats); $list->setBool("ShowVoteBox", $votebox); $list->setBool("useCache", $cache); $output = $list->DisplayList(); return $output; }
function renderpageTools($input) { global $wgUser, $wgTitle, $wgOut, $IP; require_once "{$IP}/extensions/ListPages/ListPagesClass.php"; $parser = new Parser(); $list = new ListPages(); $list->setBool("ShowCtg", "yes"); $relatedctgArray = explode(",", strip_tags($list->getCategoryLinks($wgTitle->mArticleID, 7))); foreach ($relatedctgArray as $ctg) { if ($ctg != "") { $ctg = trim(strtoupper($ctg)); if ($ctg != "NEWS" && $ctg != "OPINIONS") { if ($ctgstr != "") { $ctgstr .= ","; } $CtgTitle = Title::newFromText($parser->transformMsg(trim($ctg), $wgOut->parserOptions())); $ctgstr .= $CtgTitle->getDbKey(); } } } $output = ""; $output .= '<a href="#pageToolsTop"></a><table cellpadding="0" cellspacing="0" border="0"><tr>'; $output .= '<td width="100" id="commentsBtn" class="toptabsOn" onmousedown=\'javascript:$("commentsBtn").className="toptabsOn";$("historyBtn").className="toptabs";$("emailBtn").className="toptabs";$("relatedBtn").className="toptabs";getContent("index.php?title=Special:CommentAction&Action=2","pid=' . $wgTitle->mArticleID . '&shwform=1&ord=0","pageToolsContent")\'>Comments</td>'; $output .= '<td width="5" class="topright"> </td>'; $output .= '<td width="100" id="emailBtn" class="toptabs" onmousedown=\'javascript:$("emailBtn").className="toptabsOn";$("historyBtn").className="toptabs";$("commentsBtn").className="toptabs";$("relatedBtn").className="toptabs";getContent("index.php?title=Special:EmailThis&pageid=' . $wgTitle->mArticleID . '","","pageToolsContent")\'>Email This</td>'; $output .= '<td width="5" class="topright"> </td>'; $output .= '<td width="100" id="relatedBtn" class="toptabs" onmousedown=\'$("relatedBtn").className="toptabsOn";$("historyBtn").className="toptabs";$("commentsBtn").className="toptabs";$("emailBtn").className="toptabs";javascript:getContent("index.php?title=Special:ListPagesAction","shw=15&ctg=' . $ctgstr . '&ord=PUBLISHEDDATE&lv=1&shwctg=1&det=0&pub=1","pageToolsContent")\'>Related Articles</td>'; $output .= '<td width="5" class="topright"> </td>'; $output .= '<td width="100" id="historyBtn" class="toptabs" onmousedown=\'$("historyBtn").className="toptabsOn";$("relatedBtn").className="toptabs";$("commentsBtn").className="toptabs";$("emailBtn").className="toptabs";javascript:getContent("index.php?title=Special:PageHistoryAJAX&pid=' . $wgTitle->mArticleID . '","","pageToolsContent")\'>Page History</td><td width="300" class="topright"> </td>'; $output .= '</tr></table><br/><div id="pageToolsContent">'; return $output; }
function execute() { global $wgUser, $wgOut; require_once 'ListPagesClass.php'; $list = new ListPages(); $list->setCategory(str_replace("|", ",", $_GET["ctg"])); $list->setShowCount($_GET["shw"]); $list->setPageNo($_GET["pg"]); $list->setOrder($_GET["ord"]); $list->setLevel($_GET["lv"]); $list->setShowDetails($_GET["det"]); $list->setShowPublished($_GET["pub"]); $list->setBool("ShowNav", $_GET["nav"]); $list->setBool("ShowDate", $_GET["shwdt"]); $list->setBool("ShowStats", $_GET["shwst"]); $out = $list->DisplayList(); $out = str_replace("'", "\\'", $out); $out = str_replace(chr(10), "');document.write('", $out); $wgOut->addHTML("document.write ('" . $out . "')"); $wgOut->setArticleBodyOnly(true); }