help with comments help with comments
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

help with comments

Started by zom, April 26, 2006, 09:32:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zom

I have change line 2323 in theme.inc to limit the number of comments to 20 :

$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 LIMIT 20");

But I wuold like the lasts comment to be shown, how to do that ?

Could it be possible to errase oldest comments when a new one is entered ?

thanks

Thanks to everyone

Nibbler

Change

ORDER BY msg_id

to

ORDER BY msg_id DESC

zom

thanks foryour help, but adding "DESC" :

author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id DESC $comment_sort_order LIMIT 50"

gives me an error : error of request
Thanks to everyone

Stramm

of course you should remove then the variable that holds the sort order... otherwise you have it double in the satatment what leads to an error

ORDER BY msg_id DESC LIMIT 20

zom

many thanks for your help !

to remove older comments than the last 50 ones is a way to do it (even if it is manually by a mysql request in php myadmin) ?
Thanks to everyone

Joachim Müller