Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. <?php
  2. while($rows=mysql_fetch_array($result)){
  3. $pid=$rows['id'];
  4. $d = $rows['date'];
  5. echo '<style>tr, td {border:0;} #dat{text-align:right;} #co {background-color:#33B533;} </style>';
  6. echo '<div id="postd">';
  7. echo '<table id="mdata">';
  8. echo '<tr>';
  9. echo '<td>';
  10. echo '<a href="profile.php?name=';
  11. echo $rows['name'];
  12. echo '">' . $rows["name"] . '</a>';
  13. echo '</td>';
  14. echo '<td id="dat">';
  15. echo $result7 = nicetime($d);
  16. echo '</td>';
  17. echo '</tr>';
  18. echo '<tr>';
  19. echo '<td>';
  20. echo $rows['post'];
  21. echo '</td>';
  22. echo '<td id="dat">';
  23. echo '<form method="post" action="delete.php">';
  24. echo '<input type="hidden" value="';
  25. echo $rows['id'] . '" name="id" />';
  26. echo '<input id="sub" type="submit" name="delete" value="Delete" />';
  27. echo '</form>';
  28. echo '<form method="post" action="edit.php">';
  29. echo '<input type="hidden" value="';
  30. echo $rows['id'] . '" name="id" />';
  31. echo '<input id="sub" type="submit" name="edit" value="Edit" />';
  32. echo '</form>';
  33. echo '</td>';
  34. echo '</tr>';
  35. echo '<tr>';
  36. echo '<td>';
  37.  
  38. $sql9 = "SELECT * FROM `like` WHERE postid='$pid' AND userid='$userid'";
  39. $result9=mysql_query($sql9);
  40.  
  41. if($result9){
  42. echo '<form method="post" action="like.php">';
  43. echo '<input type="hidden" value="';
  44. echo $rows['id'] . '" name="id" />';
  45. echo '<input type="hidden" value="';
  46. echo $userid . '" name="nid" />';
  47. echo '<input id="sub" type="submit" name="like" value="Like" />';
  48. echo '</form>';
  49. }
  50. echo '</td>';
  51. echo '<td id="dat">';
  52. if ($rows['like'] == 1) {
  53. echo $rows['like'] . " Like";
  54. } else if ($rows['like'] == 0) {
  55. echo "";
  56. } else {
  57. echo $rows['like'] . " Likes";
  58. }
  59. echo '</td>';
  60. echo '</tr>';
  61. echo '</table>';
  62. echo '</div>';
  63.  
  64. $sql2="SELECT * FROM comments WHERE postid='$pid' ORDER BY date ASC";
  65. $result2=mysql_query($sql2);
  66.  
  67. while($rows2=mysql_fetch_array($result2)){
  68. $c = $rows2['date'];
  69. echo '<table id="co" border="1px solid black" width="250px" align="center">';
  70. echo '<tr>';
  71. echo '<td>';
  72. echo $rows2['name'];
  73. echo '</td>';
  74. echo '<td id="dat">';
  75. echo $result4 = nicetime($c);
  76. echo '</td>';
  77. echo '</tr>';
  78. echo '<tr>';
  79. echo '<td>';
  80. echo $rows2['comment'];
  81. echo '</td>';
  82. echo '</tr>';
  83. echo '</table>';
  84. }
  85.  
  86. echo '<form action="addcomment.php" method="post">';
  87. echo '<table id="co" border="1px solid black" width="250px" align="center">';
  88. echo '<tr>';
  89. echo '<td>';
  90. echo '<textarea id="target" type="text" name="com" placeholder="Comment"></textarea>';
  91. echo '</td>';
  92. echo '<td>';
  93. echo '<input type="submit" name="submit" value="Post">';
  94. echo '</td>';
  95. echo '</tr>';
  96. echo '</table>';
  97. echo '<input type="hidden" value="';
  98. echo $rows['id'] . '" name="id" />';
  99. echo '<input type="hidden" name="name" value="Jon" />';
  100. echo '</form>';
  101.  
  102. echo '<br/>';
  103.  
  104.  
  105. }
  106.  
  107. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement