Title
|
Started By
|
#
|
Last Reply
|
1) { $posts = “Posts”; }
// else { $posts = “Post”; }
// QUERY FOR PARENT POST DETAILS
$post_details = mysql_query(“select * FROM beosnews_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 beosnews_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 beosnews_comments WHERE (comment_post_ID = ‘$post_id’ AND comment_approved = ‘1’ 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);
}
// query for details of the first post – to find the type
$first_post_details = mysql_query(“select * FROM beosnews_comments WHERE (comment_post_ID = ‘$post_id’ AND comment_approved = ‘1’ AND comment_type != ‘pingback’) ORDER BY comment_ID limit 1;”);
while($row = mysql_fetch_array($first_post_details))
{
$comment_type = $row[‘comment_type’];
}
// SETUP THE COLOUR-CODING FOR USER-POSTED THREADS
if ($comment_type == “user_thread”)
{
$tr_class = “contentForumRow”;
$link_style = “color: #027522;”;
}
else
{
$link_style = “”;
$tr_class = “”;
}
// OUTPUT
echo “
“;
echo “
$post_title |
“;
echo “
$username |
“;
echo “
“;
echo “
$last_comment_date by $last_comment_author |
“;
echo “
“;
}
?>