Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- while($rows=mysql_fetch_array($result)){
- $pid=$rows['id'];
- $d = $rows['date'];
- echo '<style>tr, td {border:0;} #dat{text-align:right;} #co {background-color:#33B533;} </style>';
- echo '<div id="postd">';
- echo '<table id="mdata">';
- echo '<tr>';
- echo '<td>';
- echo '<a href="profile.php?name=';
- echo $rows['name'];
- echo '">' . $rows["name"] . '</a>';
- echo '</td>';
- echo '<td id="dat">';
- echo $result7 = nicetime($d);
- echo '</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>';
- echo $rows['post'];
- echo '</td>';
- echo '<td id="dat">';
- echo '<form method="post" action="delete.php">';
- echo '<input type="hidden" value="';
- echo $rows['id'] . '" name="id" />';
- echo '<input id="sub" type="submit" name="delete" value="Delete" />';
- echo '</form>';
- echo '<form method="post" action="edit.php">';
- echo '<input type="hidden" value="';
- echo $rows['id'] . '" name="id" />';
- echo '<input id="sub" type="submit" name="edit" value="Edit" />';
- echo '</form>';
- echo '</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>';
- $sql9 = "SELECT * FROM `like` WHERE postid='$pid' AND userid='$userid'";
- $result9=mysql_query($sql9);
- if($result9){
- echo '<form method="post" action="like.php">';
- echo '<input type="hidden" value="';
- echo $rows['id'] . '" name="id" />';
- echo '<input type="hidden" value="';
- echo $userid . '" name="nid" />';
- echo '<input id="sub" type="submit" name="like" value="Like" />';
- echo '</form>';
- }
- echo '</td>';
- echo '<td id="dat">';
- if ($rows['like'] == 1) {
- echo $rows['like'] . " Like";
- } else if ($rows['like'] == 0) {
- echo "";
- } else {
- echo $rows['like'] . " Likes";
- }
- echo '</td>';
- echo '</tr>';
- echo '</table>';
- echo '</div>';
- $sql2="SELECT * FROM comments WHERE postid='$pid' ORDER BY date ASC";
- $result2=mysql_query($sql2);
- while($rows2=mysql_fetch_array($result2)){
- $c = $rows2['date'];
- echo '<table id="co" border="1px solid black" width="250px" align="center">';
- echo '<tr>';
- echo '<td>';
- echo $rows2['name'];
- echo '</td>';
- echo '<td id="dat">';
- echo $result4 = nicetime($c);
- echo '</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>';
- echo $rows2['comment'];
- echo '</td>';
- echo '</tr>';
- echo '</table>';
- }
- echo '<form action="addcomment.php" method="post">';
- echo '<table id="co" border="1px solid black" width="250px" align="center">';
- echo '<tr>';
- echo '<td>';
- echo '<textarea id="target" type="text" name="com" placeholder="Comment"></textarea>';
- echo '</td>';
- echo '<td>';
- echo '<input type="submit" name="submit" value="Post">';
- echo '</td>';
- echo '</tr>';
- echo '</table>';
- echo '<input type="hidden" value="';
- echo $rows['id'] . '" name="id" />';
- echo '<input type="hidden" name="name" value="Jon" />';
- echo '</form>';
- echo '<br/>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement