• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Stats are not working

siddharth

💖 Chevereto Fan
Suddenly Stats in my website are not working. Few days back I noticed the counts are getting reduced, now the website is totally showing wrong stats liks 0 images and also wrong space info and manything are wrong.

How do I re generate the stats and make sure it reflects the correct count always.
 
Last edited:
Taken from app/install/installer.php

SQL:
TRUNCATE TABLE `chv_stats`;

INSERT INTO `chv_stats` (stat_id, stat_date_gmt, stat_type) VALUES ("1", NULL, "total") ON DUPLICATE KEY UPDATE stat_type=stat_type;

UPDATE `chv_stats` SET
stat_images = (SELECT IFNULL(COUNT(*),0) FROM `chv_images`),
stat_albums = (SELECT IFNULL(COUNT(*),0) FROM `chv_albums`),
stat_users = (SELECT IFNULL(COUNT(*),0) FROM `chv_users`),
stat_image_views = (SELECT IFNULL(SUM(image_views),0) FROM `chv_images`),
stat_disk_used = (SELECT IFNULL(SUM(image_size) + SUM(image_thumb_size) + SUM(image_medium_size),0) FROM `chv_images`)
WHERE stat_type = "total";

INSERT INTO `chv_stats` (stat_type, stat_date_gmt, stat_images, stat_image_views, stat_disk_used)
SELECT sb.stat_type, sb.stat_date_gmt, sb.stat_images, sb.stat_image_views, sb.stat_disk_used
FROM (SELECT "date" AS stat_type, DATE(image_date_gmt) AS stat_date_gmt, COUNT(*) AS stat_images, SUM(image_views) AS stat_image_views, SUM(image_size + image_thumb_size + image_medium_size) AS stat_disk_used FROM `chv_images` GROUP BY DATE(image_date_gmt)) AS sb
ON DUPLICATE KEY UPDATE stat_images = sb.stat_images;

INSERT INTO `chv_stats` (stat_type, stat_date_gmt, stat_users)
SELECT sb.stat_type, sb.stat_date_gmt, sb.stat_users
FROM (SELECT "date" AS stat_type, DATE(user_date_gmt) AS stat_date_gmt, COUNT(*) AS stat_users FROM `chv_users` GROUP BY DATE(user_date_gmt)) AS sb
ON DUPLICATE KEY UPDATE stat_users = sb.stat_users;

INSERT INTO `chv_stats` (stat_type, stat_date_gmt, stat_albums)
SELECT sb.stat_type, sb.stat_date_gmt, sb.stat_albums
FROM (SELECT "date" AS stat_type, DATE(album_date_gmt) AS stat_date_gmt, COUNT(*) AS stat_albums FROM `chv_albums` GROUP BY DATE(album_date_gmt)) AS sb
ON DUPLICATE KEY UPDATE stat_albums = sb.stat_albums;

UPDATE `chv_users` SET user_content_views = COALESCE((SELECT SUM(image_views) FROM `chv_images` WHERE image_user_id = user_id GROUP BY user_id), "0");
 
Unfortunately, this ticket has more than seven days without a reply or feedback from the original poster. We will now consider this ticket abandoned and its now closed.

Don't hesitate to create a new ticket if this matter is still causing you issues.

Ticket closed.
 
Back
Top