<br/> <br/> <?php listCategories($Categories, $SessionPerson->role()); ?> <div class="container col-md-8"> <?php $posts = $BlogPosts->getAllForUser($id, ITEMS_PER_PAGE, $offset); $count = count($posts); if ($count > 0) { foreach ($posts as $b) { $categoryName = $Categories->get($b["category"])["name"]; $ans = $b["correctAnswerId"] > 0; $opened = $b["marked"] == 0; if ($opened || $page->isAdmin($Role)) { blogPostWithCategory($b["id"], $b["title"], $id, $firstName, $lastName, $b["date_posted"], $b["category"], $categoryName, $ans, $opened); } } pagination($number, $count, $page); } else { ?> <div class="panel panel-default"> <div class="panel-body text-center"> <div class="row"> <p>No Posts.</p> </div> </div> </div> <?php }
/** * Post a new comment. * * @global Smarty $smarty * @param integer $kll_id * @param string $author * @param string $comment * @param string $password * @return xajaxResponse */ function postComments($kll_id, $author, $comment, $password = '') { if (config::get('comments')) { $kll_id = intval($kll_id); $comments = new Comments($kll_id); global $smarty; $config = new Config(); $page = new Page("Comments"); $comments = new Comments($kll_id); $pw = false; if (!config::get('comments_pw') || $page->isAdmin()) { $pw = true; } if ($pw || crypt($password, config::get("comment_password")) == config::get("comment_password")) { if ($comment == '') { return getComments($kll_id, 'Error: The silent type, hey? Good for you, bad for a comment.'); } else { if (!$author) { $author = 'Anonymous'; } $comments->addComment($author, $comment); return getComments($kll_id); } } else { // Password is wrong return getComments($kll_id, 'Error: Wrong Password'); } } else { return false; } }
<?php $page = new Page("Home", $SessionPerson); $page->getModule("categories"); $page->getModule("blogPost"); $page->showHeader(); if ($page->isAdmin($Role)) { echo "<a href=" . $page->link("home", "admin") . ">Admin Panel</a>"; } ?> <div class="container col-md-12"> <div class="panel-body text-center"> <!--<h2><?php echo $page->getTitle(); ?> </h2>--> <img src="<?php echo $page->getAsset("images/Home_Logo.png"); ?> " alt="home"> </div> </div> <?php listCategories($Categories, $SessionPerson->role()); ?> <div class="container col-md-6"> <?php
<div class="panel-body text-center"> <h3><?php echo $post["title"]; ?> </h3> <br/> </div> </div> <?php listCategories($Categories, $SessionPerson->role()); ?> <div class="container col-md-8"> <?php if ($page->isAdmin($Role)) { if ($post["marked"] == 0) { ?> [ <a href="?page=postFunctions&prefix=admin&func=closePost&postId=<?php echo $id; ?> &ref=question">Close Post</a>] <?php } else { ?> [ <a href="?page=postFunctions&prefix=admin&func=openPost&postId=<?php echo $id; ?>
<?php /** * @package EDK */ $page = new Page('Post killmail'); if (isset($_POST['undelete']) && isset($_POST['kll_id']) && $page->isAdmin()) { $kll_id = intval($_POST['kll_id']); $qry = DBFactory::getDBQuery(); $qry->execute("DELETE FROM kb3_mails WHERE kll_id = " . $kll_id); if (isset($_POST['killmail'])) { $html = post(); } else { $html = "Mail lock has been removed."; } } else { if (isset($_POST['killmail'])) { $html = post(); } } if (isset($html)) { $smarty->assign('error', $html); } $smarty->assign('isadmin', $page->isAdmin()); $smarty->assign('post_forbid', config::get('post_forbid')); $smarty->assign('post_oog_forbid', config::get('post_oog_forbid')); $smarty->assign('actionURL', edkURI::page("post")); $page->setContent($smarty->fetch(get_tpl('post'))); $page->generate(); function post() {