Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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
SELECT i.image_category_id id, c.category_name name, COUNT(1) count
FROM chv_images i
LEFT JOIN chv_categories c ON c.category_id = i.image_category_id
WHERE i.image_category_id IS NOT NULL
GROUP BY i.image_category_id;
Do please note that this is an expensive query. Don't call it on every request.
Thank you @Rodolfo for your answer. Can you tell me in which file I have to put the code. And that's where I can see the number of images by category as in the picture above.
You must execute that query using CHV\DB. I must insist, DO NOT call that query on every request. It will eat like 2 seconds of request time and it could compromise your server (ddos).
PHP:
$fetch = CHV\DB::queryFetchAll('
SELECT i.image_category_id id, c.category_name name, COUNT(1) count
FROM chv_images i
LEFT JOIN chv_categories c ON c.category_id = i.image_category_id
WHERE i.image_category_id IS NOT NULL
GROUP BY i.image_category_id;');