1) { $posts = "Posts"; } // else { $posts = "Post"; } // QUERY FOR PARENT POST DETAILS $post_details = mysql_query("select * FROM wp_posts WHERE (ID = '$comment_post_ID');"); while($row = mysql_fetch_array($post_details)) { $post_id = $row['ID']; $post_title = $row['post_title']; $post_author = $row['post_author']; } // QUERY FOR AUTHOR DETAILS FOR COMMENTS ON FRONTPAGE POSTS $author_details = mysql_query("select * FROM wp_users WHERE (ID = '$post_author');"); while($row = mysql_fetch_array($author_details)) { $username = $row['display_name']; } // QUERY FOR DETAILS OF LAST POST $last_post_details = mysql_query("select * FROM wp_comments WHERE (comment_post_ID = '$post_id' AND comment_type != 'pingback') ORDER BY comment_ID DESC limit 1;"); while($row = mysql_fetch_array($last_post_details)) { $last_comment_author = $row['comment_author']; $last_comment_date = $row['comment_date']; $last_comment_dateChunks = explode(" ", $last_comment_date); $last_comment_date = $last_comment_dateChunks[0]; $last_comment_date = str_replace("-", ".", $last_comment_date); } // OUTPUT echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } ?>
Title Started By
#
Last Reply
$post_title
$username
$num_posts
$last_comment_date
by $last_comment_author