Example #1
0
<?php 
include_once 'views/header.php';
?>


<!-- <h1 class="col-md-8 col-md-offset-2 page-header"> Posts </h1> -->
      <div id="posts" class="col-md-8 col-md-offset-2">
         <?php 
//If the full display flag is set, show the post
if ($fulldisp == 1) {
    // Get the URL if one wasn't passed
    $url = isset($url) ? $url : $p['url'];
    // Build the admin links
    $admin = isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == 1 ? adminLinks($page, $url) : array('edit' => NULL, 'delete' => NULL);
    // Format the image if one exists
    $img = formatImage($p['image'], $p['title']);
    if ($page == 'thread') {
        // Load the comment object
        include_once 'inc/comments.inc.php';
        $comments = new Comments();
        $comment_disp = $comments->showComments($p['postID']);
        $comment_form = $_SESSION['username'] ? $comments->showCommentForm($p['postID'], $_SESSION['username']) : NULL;
    } else {
        $comment_form = NULL;
    }
    ?>

         <article>
         <h1 class="page-header"><small><?php 
    echo $p['title'];
    ?>
Example #2
0
        You are logged in!
        <a href="/inc/update.inc.php?action=logout">Log out</a>.
    </p>
<?php 
}
?>
<div id="entries">
    <?php 
if ($fulldisp == 1) {
    $url = isset($url) ? $url : $e['url'];
    if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == 1) {
        $admin = adminLinks($page, $url);
    } else {
        $admin = array('edit' => null, 'delete' => null);
    }
    $img = formatImage($e['image'], $e['title']);
    if ($page == 'blog') {
        include_once 'inc/comments.inc.php';
        $comments = new Comments();
        $comment_disp = $comments->showComments($e['id']);
        $comment_form = $comments->showCommentForm($e['id']);
        $twitter = postToTwitter($e['title']);
    } else {
        $comment_form = null;
        $twitter = NULL;
    }
    ?>
        <h2> <?php 
    echo $e['title'];
    ?>
 </h2>