coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: jensb on October 19, 2005, 06:32:07 PM

Title: Sorting comments
Post by: jensb on October 19, 2005, 06:32:07 PM
Hi !

Is there a way to display pic comments with in reversed order .. ie newest first ?

thankful for any help I get :)

regards Jens
Title: Re: Sorting comments
Post by: Abbas Ali on October 19, 2005, 07:47:55 PM
Edit displayimage.php

Replace (in function html_comments)


$result = db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id ASC");


with


$result = db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id DESC");



Abbas
Title: Re: Sorting comments
Post by: jensb on October 22, 2005, 06:05:25 AM
thanx mate :)