tvheadend/vendor/ext-3.4.1/examples/view/get-images.php
Adam Sutton bafcfff42d webui: restructure webui/extjs source files
I want to keep the 3rd-party packages away from the main source
where possible.
2013-06-03 17:11:01 +01:00

14 lines
393 B
PHP

<?php
$dir = "images/thumbs/";
$images = array();
$d = dir($dir);
while($name = $d->read()){
if(!preg_match('/\.(jpg|gif|png)$/', $name)) continue;
$size = filesize($dir.$name);
$lastmod = filemtime($dir.$name)*1000;
$images[] = array('name'=>$name, 'size'=>$size,
'lastmod'=>$lastmod, 'url'=>$dir.$name);
}
$d->close();
$o = array('images'=>$images);
echo json_encode($o);