[thelist] Gallery -- not for looks... suggestions?

Bob Meetin ontheroad at frii.com
Sat Mar 17 09:58:49 CDT 2007


Mickey,  If the site is BSD, Linux, UNIX, you can try this.  This is a 
cheap .cgi script that will scan all the files (images) in a 
directory/folder.  I have done "NOTHING" to make it standards compliant, 
played a little bit with formatting only, so just functional.  To use it 
on Linux, copy it to whatever.cgi, perhaps list_images.cgi.  Make it 
executable, chmod 555 list_image.cgi.  Then point the browser to it.

#!/bin/sh
echo "content-type: text/html"
echo ""
echo "<html><body bgcolor='#555555'>"
echo "<center>"

list=`ls | grep -v cgi | grep -v list`
echo "<div style='color: #fff; border: 1px solid #ff0000;'>"
for item in $list
do
    l=`imgsize $item | cut -f1 -d' '`
    w=`imgsize $item | cut -f2 -d' '`
    s=`ls -l $item | awk '{print $5}'`
    echo "<h2>Image name: $item</h2>"
    echo "<img src=$item style='border: 1px solid #fff; padding: 5px;>"
    echo "<br>"
    echo "$s bytes / $l - $w"
    echo "<hr style=\"clear:both;background-color:#000;border-top: 1px 
solid #ccc; border-bottom: 1px solid #ddd; width:80%;height:2px;\">"
done
exit ()

echo "</div>"
echo "</center>";
echo "</body></html>"

If you need something .php based, we could do something similar (using 
some of the suggestions earlier this week) to get a list of images, then 
float them in a <div> or whatever.  imgsize might or might not be 
available depending on hosting.

-Bob
> Howdy all,
>
> I have a ka-zillion images that I need to get up on the net... for 
> personal usage between me and my client.
>
>
>   





More information about the thelist mailing list