JonnySnip3r Posted August 8, 2010 Share Posted August 8, 2010 Hey guys i have been making a comment and reply script. When the user makes a post and others reply they appear below. However when another person makes a post and a reply is made to that they mess up it has the comments at the top and the replys at the bottom. DOes anyone know how i could order these? Or is there a tutorial online. Hope someone can help. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/210145-php-comments-and-reply-script/ Share on other sites More sharing options...
wildteen88 Posted August 8, 2010 Share Posted August 8, 2010 Post your current code here (wrap it within code tags ( ). Quote Link to comment https://forums.phpfreaks.com/topic/210145-php-comments-and-reply-script/#findComment-1096690 Share on other sites More sharing options...
JonnySnip3r Posted August 8, 2010 Author Share Posted August 8, 2010 $query = mysql_query("SELECT * FROM comments_messages WHERE message_reply_to_member_id = '$my_id'"); while($row = mysql_fetch_assoc($query)){ $message_id = $row['message_id']; $message_reply_to_id = $row['message_reply_to_member_id']; $message_from_member_id = $row['message_from_member_id']; $message_title = $row['message_title']; $message_contents = $row['message_contents']; $message_time_date = $row['message_time_date']; $member_image = $row['member_image']; $message_reported = $row['message_reported']; echo "<div class='commentHome'>"; echo "<img src='profile/images/$member_image' alt='member profile picture' />"; echo "<h3>$message_title <small><i>$message_time_date</i> (from: <strong>". get_member_name_from_member_id($message_from_member_id) ."</strong> )</small></h3>"; echo "<p>". rec_message_bad_word_filter($message_contents) ."</p>"; echo "<div id='box'>"; echo "<br />"; echo "<form method='post' action=''>"; echo "<input type='text' name='comment' placeholder='quick reply...' onclick=\"$.jGrowl('Enter your reply to this message. e.g: Hey, Dude!', { header: 'Reply Field' });\" href=\"javascript:void(0);\"/>"; echo "<input type='hidden' name='member_id_to' value='$message_from_member_id'/>"; echo "<input type='hidden' name='title' value='$message_title'/>"; echo "</form>"; echo "</div>"; echo "</div>"; } $query = mysql_query("SELECT * FROM comments_messages WHERE message_from_member_id = '$my_id'"); while($row = mysql_fetch_assoc($query)){ $message_id = $row['message_id']; $message_reply_to_id = $row['message_reply_to_member_id']; $message_from_member_id = $row['message_from_member_id']; $message_title = $row['message_title']; $message_contents = $row['message_contents']; $message_time_date = $row['message_time_date']; $member_image = $row['member_image']; $message_reported = $row['message_reported']; $message_reported_to = $row['message_reported_to]; echo "<div class='commentHome2'>"; echo "<img src='profile/images/$member_image' alt='member profile picture' />"; echo "<h3>$message_title <small><i>$message_time_date</i> (from: me)</small></h3>"; echo "<p>". rec_message_bad_word_filter($message_contents) ."</p>"; echo "<p class='rec_by'>"; /* echo "<a href=\"#\" id=\"$message_id\" class=\"delbutton\"> <img src='profile/icons/delete.png' alt='delete' title='Delete this Comment' /></a>";*/ echo "</p>"; echo "</div>"; } I know its messy and theres tons of tidying up to do Quote Link to comment https://forums.phpfreaks.com/topic/210145-php-comments-and-reply-script/#findComment-1096694 Share on other sites More sharing options...
JonnySnip3r Posted August 9, 2010 Author Share Posted August 9, 2010 anyone ? =[ Quote Link to comment https://forums.phpfreaks.com/topic/210145-php-comments-and-reply-script/#findComment-1096901 Share on other sites More sharing options...
JonnySnip3r Posted August 10, 2010 Author Share Posted August 10, 2010 please some help? Quote Link to comment https://forums.phpfreaks.com/topic/210145-php-comments-and-reply-script/#findComment-1097579 Share on other sites More sharing options...
Adam Posted August 10, 2010 Share Posted August 10, 2010 Having the post before the comments makes sense to me? Quote Link to comment https://forums.phpfreaks.com/topic/210145-php-comments-and-reply-script/#findComment-1097581 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.