I have created the following PHP script to create a list of all of the
images in a folder so that that folder may be used as a source for the
image viewer.
On my server, I created a sym-link from the webroot to a folder where I
have put all of the images I wish to display, then I have saved this
script as index.php in the same folder. Enter the webshared folder as
the image viewer source, and all images will be listed for the touch to
display.
NOTE: The script does not recurse into sub-folders. All images must be
in the same directory. Enjoy!
file:*index.php*
Code:
--------------------
<?php
// by MattRock [http://mattrock.net]
//
// list all images in current directory for
// Squeezebox Touch image viewer function
// 12/10
$dirname = ".";
$dir = opendir($dirname);
header("Content-type: text/plain");
while(false != ($file = readdir($dir))){
if (preg_match("/[^\s]+(\.(?i)(jpg|png|gif|bmp))$/",$file)) {
echo
"http://".$_SERVER['SERVER_ADDR'].$_SERVER['REQUEST_URI'].urlencode($file)."\r\n";
}
}
?>
--------------------
--
mattrock
------------------------------------------------------------------------
mattrock's Profile: http://forums.slimdevices.com/member.php?userid=42265
View this thread: http://forums.slimdevices.com/showthread.php?t=84140
_______________________________________________
Touch mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/touch