Beispiel #1
0
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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</td>';
    $output .= '</tr></table><br/><div id="pageToolsContent">';
    return $output;
}
Beispiel #2
0
function renderFeeds($input)
{
    global $wgOut;
    require_once 'ListPagesClass.php';
    purgePage();
    $wgOut->setOnloadHandler("start()");
    $wgOut->addScript("<script type=\"text/javascript\" src=\"extensions/viewFeeds.js\"></script>\n");
    $output = "";
    //$output .= " status: <span id=status></span><br> status2: <span id=status2></span>";
    $output .= "<a href=javascript:addFeed()>Add Feed</a><br><br><div id=listpages>";
    $items .= "var feedItems = [];";
    $dbr =& wfGetDB(DB_SLAVE);
    $sql = "SELECT feed_id,feed_title,feed_count,feed_ctg,feed_order_by,feed_item_order FROM feeds WHERE feed_mirror_id=1 ORDER BY feed_item_order";
    $res = $dbr->query($sql);
    $x = 0;
    while ($row = $dbr->fetchObject($res)) {
        $output .= "<div class=feedItem id=item_" . $row->feed_id . ">";
        $output .= "<span class=feedEdit><a href=# class=editFeed id=el_" . $row->feed_id . " >edit<a> | <a href=# class=deleteFeed id=dl_" . $row->feed_id . ">remove</a></span>";
        $output .= "<span class=title>" . $row->feed_title . "</span>";
        $output .= "<br><br>";
        $list = new ListPages();
        $list->setCategory($row->feed_ctg);
        $list->setShowCount($row->feed_count);
        $list->setPageNo(1);
        $list->setOrder($row->feed_order_by);
        $list->setShowDetails("VoteBox");
        $list->setShowPublished("Yes");
        $output .= $list->DisplayList();
        $output .= "</div>";
        $items .= "feedItems[" . $x . "] = {id:" . $row->feed_id . ",title:'" . str_replace("'", "\\'", $row->feed_title) . "',categories:'" . str_replace("'", "\\'", $row->feed_ctg) . "',count:" . $row->feed_count . ",itemOrder:" . $x . ",orderBy:'" . $row->feed_order_by . "'};";
        $x++;
    }
    $output .= "</div>";
    $output .= "<script>" . $items . "</script>";
    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);
 }
Beispiel #4
0
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;
}