Jump to content

MilboW

New Members
  • Posts

    7
  • Joined

  • Last visited

MilboW's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I tried to include the function, but nothing really happens, could you take a look at my code, and tell me what im doing wrong?
  2. http://puu.sh/4v6WV.png http://puu.sh/4v6Wq.png Provided some pictures below, <?php // Page Initialization $level = ''; $page = 'post'; include($level.'includes/config.php'); // Variables $error = $success = ""; // Get Post Info if (isset($_GET['id'])) { $post = $POSTS->getPostById($_GET['id']); if (!$post) { if (isset($_SESSION['last_page'])) { header('Location: '.$_SESSION['last_page']); } else { header('Location: index.php'); } } } else { if (isset($_SESSION['last_page'])) { header('Location: '.$_SESSION['last_page']); } else { header('Location: index.php'); } } // POST - Reply if (isset($_POST['reply'])) { $reply = strip_tags(Clean($_POST['reply'])); if ($reply != "") { $time = time(); $DB->RowInsert('replies', array('post' => $post->id, 'posted' => $time, 'user' => $_SESSION['user_id'], 'content' => $reply)); $DB->FieldSet('posts', 'lastupdated', $time, 'id', $post->id); } else { $error = "Enter a Reply"; } } // Set Last Page $_SESSION['last_page'] = 'post.php?id='.$_GET['id']; ?> <?php include("parts/doctype.php"); ?> <head> <title><?php echo $post->title; ?></title> <?php include("parts/meta.php"); ?> </head> <body> <div id="whole"> <div id="header"><?php include("parts/header.php"); ?></div> <div id="main"> <h1><?php echo stripslashes($post->title); ?></h1> <div class="postrow"> <a href="user.php?id=<?php echo $post->user; ?>"><img class="usericon" src="images/users/<?php echo $DB->FieldGet('users', 'avatar', 'id', $post->user); ?>" alt="<?php echo $DB->FieldGet('users', 'firstname', 'id', $post->user); ?>" title="<?php echo $DB->FieldGet('users', 'firstname', 'id', $post->user); ?>"></a> <div class="posttext"> <p><?php echo stripslashes(nl2br($post->content)); ?></p> <?php if ($DB->FieldGet('users', 'permissions', 'id', $_SESSION['user_id']) == 1) { ?> <a href='delete_post.php?id=<?php echo $post->id; ?>'><img class="deleteicon2" src="images/delete.png" alt="Delete Reply" title="Delete Reply"></a> <?php } ?> <p class="timestamp"><?php echo date('F j, Y', $post->posted); ?> at <?php echo date('g:i a', $post->posted); ?></p> </div> </div> <?php $replies = $POSTS->getReplies($post->id); if ($replies) { foreach ($replies as $reply) {?> <div class="postrow"> <a href="user.php?id=<?php echo $reply->user; ?>"><img class="usericon" src="images/users/<?php echo $DB->FieldGet('users', 'avatar', 'id', $reply->user); ?>" alt="<?php echo $DB->FieldGet('users', 'firstname', 'id', $reply->user); ?>" title="<?php echo $DB->FieldGet('users', 'firstname', 'id', $reply->user); ?>"></a> <div class="posttext"> <p><?php echo stripslashes(nl2br($reply->content)); ?></p> <?php if ($DB->FieldGet('users', 'permissions', 'id', $_SESSION['user_id']) == 1) { ?> <a href='delete_reply.php?id=<?php echo $reply->id; ?>'><img class="deleteicon2" src="images/delete.png" alt="Delete Reply" title="Delete Reply"></a> <?php } ?> <p class="timestamp"><?php echo date('F j, Y', $reply->posted); ?> at <?php echo date('g:i a', $reply->posted); ?></p> </div> </div> <?php } } ?> <?php if ($USERS->checkLogin()) { ?> <div id="replybox"> <img class="usericon" src="images/users/<?php echo $DB->FieldGet('users', 'avatar', 'id', $_SESSION['user_id']); ?>" alt="<?php echo $DB->FieldGet('users', 'firstname', 'id', $_SESSION['user_id']); ?>" title="<?php echo $DB->FieldGet('users', 'firstname', 'id', $_SESSION['user_id']); ?>"> <form method='POST'> <?php if ($error != "") { print("<p class='error4'>".$error."</p>"); } ?> <textarea id="reply" name='reply'></textarea> <input type="submit" class="button" value="Reply"> </form> </div> <?php } ?> </div> <div class="clear"></div> <div id="footerhome"><?php include("parts/footer.php"); ?></div> </div> </body> </html> And the post.php
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.