• 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.

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>

:D
 
Status
Not open for further replies.
Back
Top