예제 #1
0
파일: misc.php 프로젝트: kamilpacaq/drydock
        }
    }
    $sm = sminit("popup.tpl");
    $sm->assign("text", $message);
    $sm->assign("timeout", 5);
    // 5s
    $sm->assign("title", "Report handler");
    $sm->display("popup.tpl");
    die;
} elseif (strtolower($_GET['action']) == "getpage") {
    if (!isset($_GET['page']) || trim($_GET['page']) == "") {
        THdie("No page provided!");
    } else {
        $db = new ThornToolsDBI();
        $page = trim($_GET['page']);
        $pagedata = $db->getstaticpage($page);
        if ($pagedata == null) {
            THdie("A page by that name was not found!");
        } else {
            // Found a valid page.  Do access checking if necessary.
            switch ($pagedata['publish']) {
                case 0:
                    // Admin-only
                    if ($_SESSION['admin'] != 1) {
                        THdie("You are not permitted to access that page.");
                    }
                    break;
                case 1:
                    // Admin or mod-only
                    if ($_SESSION['admin'] != 1 && $_SESSION['mod_global'] != 1) {
                        THdie("You are not permitted to access that page.");
예제 #2
0
파일: news.php 프로젝트: kamilpacaq/drydock
    }
    $db = new ThornDBI();
    $archivelink .= $db->getboardname(THnewsboard) . '">Full News Archive</a>';
    //make our link
    ?>
		</div>
	</div>
</div>
<?php 
    include "menu.php";
    ?>

<?php 
    if ($archivelink) {
        echo '<div style="text-align: center;" style="font-family:verdana,century;font-size:10px;padding-bottom: 10px;">- ' . $archivelink . " -</div>\n";
    }
    //Otherwise, we'll use static pages
} else {
    $db = new ThornToolsDBI();
    $pagedata = $db->getstaticpage("FrontPage");
    if ($pagedata == null) {
        $pagedata = "<br />This site is powered by the drydock image board script.";
    }
    // Caching ID format: p<pageid>
    $cid = "p" . $pagedata['id'];
    // Initialize the Smarty object, display the object, and go
    $sm = sminit("staticpage.tpl", $cid, THtplset);
    $sm->assign_by_ref("page", $pagedata);
    $sm->display("staticpage.tpl", $cid);
    $sm->display("bottombar.tpl", null);
}