Ejemplo n.º 1
0
function viewMain($input)
{
    global $wgSiteView;
    require_once 'ListPagesClass.php';
    $CategoriesStr = "";
    $aCat = explode(",", $wgSiteView->getCategories());
    foreach ($aCat as $sCat) {
        if ($sCat != "") {
            if ($CategoriesStr != "") {
                $CategoriesStr .= ",";
            }
            $CategoriesStr .= $sCat . " Opinions";
        }
    }
    $list = new ListPagesView();
    $list->setCategory($CategoriesStr);
    $list->setShowCount(6);
    $list->setPageNo(1);
    $list->setOrder("PublishedDate");
    $list->setLevel(1);
    $list->setBool("showVoteBoxInTitle", "Yes");
    $list->setShowPublished(1);
    $list->setBool("ShowCtg", 1);
    $list->setBool("ShowPic", 1);
    $list->setShowBlurb(300);
    $list->setBlurbFontSize("small");
    $list->setBool("isViewMain", 1);
    $list->setHash($wgSiteView->getCategories() . "main");
    $list->setBool("useCache", 1);
    $out = $list->DisplayList();
    return "<div class=\"mainListPages\">" . $out . "</div>";
}
Ejemplo n.º 2
0
 function execute()
 {
     global $wgSiteView, $wgOut, $wgVoteDirectory;
     require_once "{$wgVoteDirectory}/VoteClass.php";
     require_once "{$wgVoteDirectory}/Publish.php";
     require_once 'ListPagesClass.php';
     if ($_POST["vm"] == 0) {
         $list = new ListPages();
     } else {
         $list = new ListPagesView();
     }
     $list->setCategory(str_replace("|", ",", $_POST["ctg"]));
     $list->setShowCount($_POST["shw"]);
     $list->setPageNo($_POST["pg"]);
     $list->setOrder($_POST["ord"]);
     $list->setSortBy($_POST["srt"]);
     $list->setLevel($_POST["lv"]);
     $list->setShowDetails($_POST["det"]);
     $list->setShowPublished($_POST["pub"]);
     $list->setBool("ShowCtg", $_POST["shwctg"]);
     $list->setBool("ShowPic", $_POST["shwpic"]);
     $list->setShowBlurb($_POST["shwb"]);
     $list->setBlurbFontSize($_POST["bfs"]);
     $list->setBool("ShowStats", $_POST["shwst"]);
     $list->setBool("ShowDate", $_POST["shwdt"]);
     $list->setBool("ShowRating", $_POST["shwrt"]);
     $list->setBool("ShowVoteBox", $_POST["shwvb"]);
     $list->setRatingMin($_POST["rtmin"]);
     //echo "date:" . $list->ShowDate;
     $out = $list->DisplayList();
     echo $out;
     // This line removes the navigation and everything else from the
     // page, if you don't set it, you get what looks like a regular wiki
     // page, with the body you defined above.
     $wgOut->setArticleBodyOnly(true);
 }