<?php

$files = '';

function rd($path) {
	global $files;
	if ($d = opendir($path)) {
		while ($i = readdir($d)) {
			if ($i == ".." || $i == ".") continue;
			if (is_dir("$path/$i")) rd("$path/$i");
			else $files[] = "$path/$i";
		}
		closedir($d);
	}
}

rd("{$ROOT}images");
rd("{$ROOT}gallery");

foreach($files as $n) echo "\t<img src=\"$n\" width=\"16\" height=\"16\" />\n";
