• 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

Counter for Pics

Status
Not open for further replies.

novexx

Chevereto Member
How can i add a counter wich shows the number of pictures that i host ?

Sry for my bad english 🙂
 
There is this php function readdir which can be used also to count files: http://www.php.net/manual/en/function.readdir.php#101719
Also there is another way using the glob function and other using DirectoryIterator

I can't recommend one of them because I haven't made a bench on each one. So, it could be "At your own risk".

Using the glob alternative it should be something like (in a theme file):
PHP:
<?php echo count(glob(__PATH_THUMBS__."*",GLOB_NOSORT)); ?>

Hope it helps.
 
You can also use the counter-code for Chevereto 1.9

smed79 said:
Hello 🙂,

Add number of uploaded images to footer...

2zrezox.jpg


open "index.php" and find :

Code:
<div id="foot"><div class="foot-d2"><?=APP_NAME;?>, Powered by <a href="http://chevereto.com/" target="_blank">Chevereto</a></div></div>

replace white :

Code:
<div id="foot"><div class="foot-d2"><?=APP_NAME;?>, Powered by <a href="http://chevereto.com/" target="_blank">Chevereto</a><br />
    <div style="font-family: Arial; font-weight: bold; color: #6F6F6F;">
<?php
// Add number of uploaded images. smed79
// $files to liste *.* in "./images" ex: (.jpg, .png, etc...)
$files = glob("images/*.*");
// Variable $compteur counting files lister ($files) in "./images"
$compteur = count($files);
echo "There are <font color=#FF0000>$compteur</font>";
if ($compteur > 1) { echo " images uploaded so far"; }
else { echo " images uploaded so far"; }
?>
    </div>
</div></div>

😀
 
Status
Not open for further replies.
Back
Top