When a user deleted with their comments, the comments count in each image not being updated.
In admin/users.php find:
if ($delcomments) {
Insert BELOW:
$sql = "SELECT i.image_id, COUNT(c.comment_id) AS count
FROM " . IMAGES_TABLE . " i
LEFT JOIN " . COMMENTS_TABLE . " c ON c.image_id = i.image_id
WHERE c.user_id = " . $user_id . "
GROUP BY i.image_id";
$result = $site_db->query($sql);
while($row = $site_db->fetch_array($result))
{
$sql = "UPDATE " . IMAGES_TABLE . "
SET image_comments = image_comments - " . $row['count'] ."
WHERE image_id = " . $row['image_id'];
$site_db->query($sql);
}
If your comments count not messed up you don't need do anything else, but for these who's comments count different from actual count you can run this MySQL query in phpmyadmin:
UPDATE 4images_images i
SET i.image_comments = (SELECT COUNT(comment_id) FROM 4images_comments WHERE image_id = i.image_id)
If the query above didn't work for you, download attached file, extract update_comments_count.php from the package and upload it to your 4images root directory then run it by typing in your browser: http://yoursiteaddress/4images/update_comments_count.php
After that delete the file.