I use to limit the number of comments by modifing displayimage.php file
$result_prelim = 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");
$numrows = (max(mysql_num_rows($result_prelim) - 10,0));
$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 LIMIT " .$numrows. ",10");
but I don't find the initial commend in coppermine 1.4.
More I would like to keep in database only the 40 last comments by picture.
Could help ?
thanks
I believe the code you're trying to find now is part of the file include/themes.inc.php
The line of code seems to be
$result = cpg_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, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");
an in db_input.php
here you need to query for the number of comments for a pic when a new comment gets added. If > max comments then delete oldest (in case you still want to delete the oldest comments)
Thank you for your information.
I understand that with a hack of db_input.php file the new comment could errase the oldest comments with a maximum o number (70 for me) of comments per image that I could choose.
Unfortunately, I am not a php tech so could you help me in the hack I should do to have this result,
very many thanks for that