How can I limit number of comments to be displayed with big picture How can I limit number of comments to be displayed with big picture
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

How can I limit number of comments to be displayed with big picture

Started by bimages, July 15, 2005, 02:01:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bimages

A number of pictures on my site have a large number of comments. I have noticed that it take toooooooo much time to display a big image if the number of comments is more than say 20. How can I limit the number of comments to be displayed with the big image.

Thanks for your help....

Nibbler

Find this query in displayimage.php, and add a LIMIT and chnage the ORDER BY too if you like

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

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

bimages

Thanks a lot for your help...

Can I also place a link or an option if someone wish to read all the comments.