![]() |
Counting .jpg images
I have a wallpapers directory with a lot of subdirectories like this:
wallpapers/category/item/file.jpg for every jpg there is also a thumnail, so I'd like to divide the total number of jpg's by 2 so I get my wallpaper count. I have had a looka t some functions at php.net but wasnt able to figure it out... |
on php5 this might help:
http://de2.php.net/manual/de/function.scandir.php on php4 you can use the dir class: http://www.php.net/manual/class.dir.php |
Would I somehow use the count function to count the files that class dir outputs?
|
should be possible, but i don't know if you have to create a new dir class for each subdirectory or not.
I haven't worked much with this class, it just know it's name an thought it may help ya :) |
PHP Code:
|
you have to write it recursively.
so wheneve the pointer shows to a directory instead of a file, then call the function using that subdirectory |
Problem being, I have no idea how to do that.
|
Could someone please help me make this recursive?
|
Here is some pseudo code on how to do it:
PHP Code:
|
I have seen code that lists things recursively, I am just not good enough at php to make an image counter with such a code.
|
All times are GMT. The time now is 03:16 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|