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"; } } ?>
Results 1 to 1 of 1
Thread: Image Viewer list script
-
2010-12-23, 22:10 #1Junior Member
- Join Date
- Dec 2010
- Posts
- 1
Image Viewer list script

Reply With Quote

