• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Get the number of picture code

tongxin

Chevereto Member
How can I get the number of web pages? For example, there are 1000 pictures, how to write, the site has saved 1000 pictures, how to write the code, thank you.
 
Use this code where you want to show total image hosted on your website publicly.
Code:
<h4>Proudly hosting <?php echo $stats['images'] > 999999 ? $stats['images'] : number_format($stats['images']); ?> images</h4>

If you just want to check the statistics, it is in dashboard.
 
Use this code where you want to show total image hosted on your website publicly.
Code:
<h4>Proudly hosting <?php echo $stats['images'] > 999999 ? $stats['images'] : number_format($stats['images']); ?> images</h4>

If you just want to check the statistics, it is in dashboard.

I'm afraid that such information is inaccurate as that code asumes the set/use of $stats variable.

Code:
$stats= CHV\Stat::getTotals();
 
I'm afraid that such information is inaccurate as that code asumes the set/use of $stats variable.

Code:
$stats= CHV\Stat::getTotals();

Code:
<?php
$stats = CHV\Stat::getTotals();
echo $stats['images'] > 999999 ? $stats['images'] : number_format($stats['images']); // Will output the total n° images
?>

This is perhaps a better implementation?
 
Back
Top