31
Mods & Plugins (Requests & Discussions) / Latest comments at the top
« on: December 24, 2002, 11:38:50 PM »
Hi Dustbunny,
this is possible but requires a little tweak of the details.php file.
If you open Details.php with a text editor or other code editor then search for this:
Right below that is a sql query which looks like this:
now in this piece of code you have to replace the following:
by:
That would do the job and as soon as the details.php file is saved and uploaded it will show the comments sorted by newest on top.
Cheers and have a pleasant Christmas,
Vraxor
this is possible but requires a little tweak of the details.php file.
If you open Details.php with a text editor or other code editor then search for this:
Code: [Select]
//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
Right below that is a sql query which looks like this:
Code: [Select]
if ($image_allow_comments == 1) {
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."
FROM ".COMMENTS_TABLE." c
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
WHERE c.image_id = $image_id
ORDER BY c.comment_date ASC";
$result = $site_db->query($sql);
now in this piece of code you have to replace the following:
Code: [Select]
ORDER BY c.comment_date ASC";
by:
Code: [Select]
ORDER BY c.comment_date DESC";
That would do the job and as soon as the details.php file is saved and uploaded it will show the comments sorted by newest on top.
Cheers and have a pleasant Christmas,
Vraxor