aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r--phpBB/includes/functions_admin.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index fc37f15cd8..8ce0975dc8 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -157,6 +157,33 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl
return $rows;
}
+function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png')
+{
+ static $matches = array();
+
+ $dh = opendir($rootdir . $dir);
+
+ while ($fname = readdir($dh))
+ {
+ if (is_file($rootdir . $dir . '/' . $fname) &&
+ preg_match('#\.' . $type . '$#i', $fname) &&
+ filesize($rootdir . $dir . '/' . $fname))
+ {
+ $matches[] = array('path' => $dir, 'file' => $fname);
+ }
+ else if ($fname != '.' && $fname != '..' &&
+ !is_file($rootdir . $dir . '/' . $fname) &&
+ !is_link($rootdir . $dir . '/' . $fname))
+ {
+ filelist($rootdir, $dir . '/'. $fname, $type);
+ }
+ }
+
+ closedir($dh);
+
+ return $matches;
+}
+
// Posts and topics manipulation
function move_topics($topic_ids, $forum_id, $auto_sync = TRUE)
{