<?php echo printHeader(true, true, "green", "news", "./news.php"); ?> <div class="container pagecontent news"> <!-- NEWS ITEMS --> <div class="content-segment" id="content"> <?php //Load the newsitems //if we're looking at one post if (!$showAll) { echo $blogpost->formatSinglePost($loggedin); } else { retrieveBlogposts(0, $postsPerPage); } ?> </div> </div> <?php printFooter(); ?> <!-- /container --> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script> <script src="js/vendor/bootstrap.min.js"></script>
<?php //initialize session if none exists if (session_id() == '' || !isset($_SESSION)) { // session isn't started session_start(); } /* * AJAX functions */ //load more blogposts if (isset($_GET['loadblogposts']) && isset($_GET['load']) && isset($_GET['offset'])) { retrieveBlogposts($_GET['offset'], $_GET['load']); } //load more events if (isset($_GET['loadevents']) && isset($_GET['load']) && isset($_GET['offset'])) { retrieveEvents($_GET['offset'], $_GET['load']); } /** * Clean form data * * Strips tags and removes/replaces certain characters from post data * * @param array $p Post data from a form * @return array $p */ function cleanData($p) { $returnArray = array(); foreach ($p as $key => $value) { //if value is an array recursively apply this function