The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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... |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
Would I somehow use the count function to count the files that class dir outputs?
|
#4
|
||||
|
||||
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 |
#5
|
|||
|
|||
PHP Code:
|
#6
|
||||
|
||||
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 |
#7
|
|||
|
|||
Problem being, I have no idea how to do that.
|
#8
|
|||
|
|||
Could someone please help me make this recursive?
|
#9
|
||||
|
||||
Here is some pseudo code on how to do it:
PHP Code:
|
#10
|
|||
|
|||
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.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|