
By: Xmoo | Date: May 20 2009 14:48 | Format: PHP | Expires: never | Size: 2.84 KB | Hits: 1157
- <?php
- // welke pagina er geshowed moet worden
- // eerste bezoek moet 0 zijn.
- if($pag == '' || $pag == 1){
- $pag = 0;
- }
- $showRecords = 5 ;
- $query = "SELECT * FROM my_comment WHERE postid = '".$_GET["p"]."".$_GET["id"]."' ORDER BY date ASC";
- //
- $pages = $num_rows / $showRecords;
- echo $pages ."<br>" ;
- //
- if($pages>1){
- //////// toegevoegde gedeelte//////////
- if($pag == 0 ) {
- $vorige_page_limit = 0 ;
- }else {
- $vorige_page_limit = $limit-$showRecords ;
- }
- /////////////////////////////////
- $query2 = 'SELECT * FROM my_comment WHERE postid = "'.$_GET["p"].'""'.$_GET["id"].'" ORDER BY date ASC LIMIT '.$vorige_page_limit.', '.$showRecords.' ';
- }
- if($pages > 1){
- echo ' | <a href=?p="'.$_GET["p"].'"&sec=view&id"'.$_GET["id"].'"&no='.$i.'>'.$i.'</a>';
- }
- echo ' |<br/><br/>';
- }
- $cid = $row->id;
- $author = $row->author;
- $comment = $row->comment;
- $comment2 = ubb_code($comment);
- $ccc=mysql_query("SELECT id,surname,middlename,lastname FROM my_users WHERE id = '".$author."'") or die(mysql_error());
- { $id = $info->id;
- $surname = $info->surname;
- $middlename = $info->middlename;
- $lastname = $info->lastname;
- echo "<b>Comment by:</b> <a href='?p=profile&id=".$id."'><u>".$surname." ".$middlename." ".$lastname."</u></a> on <u>".$date."</u> at <u>".$row['time']."</u>";
- if (($_SESSION['acces']) == A) {
- echo " [<a href='?p=cp&a=edit&sec=comment&postid=".$cid."'>Edit</a>] - [<a href='?p=cp&a=delete&sec=comment&postid=".$cid."'>Delete</a>]"; }
- echo "<br><br>".$comment2."<hr>";
- } }
- ?>
- <?php
- echo "<br><br>";
- $insert = "INSERT INTO my_comment (postid, author, date, time, comment)
- values ('".$_GET["p"]."".$_GET["id"]."', '".$_SESSION['id']."', '".$datenow."', '".$timenow."', '".entry_db($_POST["comment"])."')";
- echo "<br><br><center><font class='succes'>Comment succesfully added!</font></center><br><br>";
- echo "<meta http-equiv='refresh' content='2;'>";
- } } else {
- echo "<form action='' method='post'>";
- echo "<font color='#c8183e'>Add Comment:</font><br><textarea name='comment' cols='40' rows='6'></textarea>";
- echo "<center><input type='submit' name='submit' value='Add Comment!'></center></form>"; }
- ?>
Latest pastes
8 hours ago
5 days ago
7 days ago
9 days ago
9 days ago