This page basically describes how to create the pages I use on my websites, for picture albums. I tried quite a few condenders for this, but eventually settled in on jigle for its simplicity, controlability, and ease of use.
There are a few things to making the JIGL script work in the highly automated fashion here at pluzzi.com. The 6 steps described below are what I used to make work so that the remote users do nothing more than drag and drop pictures from their "my pictures" folder, into a folder on their website. Then wait a period of time, and voila ... pictures on the web.
Note that for the purposes of this entire document, the web share on my server is truly known as "/export/apps/www", but I soft linked it to "/usr/local/apache/htdocs" and will refer to it that way most often - but they are one and the same.
Original jigl information available here.
There were six steps to get this going. A few of these steps are home grown scripts, but they are not too difficult to follow, and all are fairly well documented.
[root@turbo bin]# cat create_slides.sh
#!/bin/bash
#
#####
##### Written by Paul A. Luzzi on 12-27-2003
#####
##### Purpose is to build a list of slides via cron
#####
##### Version 1.2 designed to remove spaces from file names
##### Version 1.3 adds in subdirectory concept
##### Version 1.3b slight tweak on v1.3
##### Version 1.3c slight tweak on v1.3b
#####
#####
##### Confirm argument was passed in.
#####
if [ "$#" -lt "1" ]
then
echo "Must pass in a website name."
echo "Exiting on error."
exit 1
fi
#####
##### Which website to do - must be argument passed in
#####
WEBSITE="$1"
#####
##### Configure PATH to have all required areas
##### - no longer needed in Fedora 8 now
#####
# export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/etc:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/export/apps/wine:/usr/bin/mh
#####
##### Start off in the main picture directory
#####
cd /export/apps/www/${WEBSITE}/pix
#####
##### Get current owner ... for later
#####
OWNER=`ls -ld . | /bin/awk '{print $3}' | /usr/bin/head -1`
GROUP="www"
################################################################
################################################################
################################################################
#####
##### Enter subdirectory loop here. Search for any directories
##### that are not "thumbs", "slides" or "." or ".."
#####
for SUBDIR in `/usr/bin/find . -type d -print | /bin/egrep -v "^.$|slides|thumbs"`
do
#####
##### Change into each directory and begin inner loop here ...
#####
echo "===================================================================="
echo "\"Entering $SUBDIR now ... \" "
cd "${SUBDIR}"
#####
##### Build variable for Dirname
#####
PRETTY_PRINT=`/bin/pwd | /bin/awk -F/ '{print $NF}' | /bin/sed -e "s/_/ /g"`
#####
##### run the jigl.pl script with the following options :
#####
##### -> "--link-original"
##### -> "--replace-spaces y"
##### -> "--go-back"
##### -> "--noskb"
##### -> "--nosxy"
##### -> "--index-title "
#####
## /usr/local/bin/jigl.pl --link-original --replace-spaces y --go-back --nosxy --noskb --index-title "$PRETTY_PRINT"
/usr/local/bin/jigl.pl --link-original --replace-spaces y --go-back --index-title "$PRETTY_PRINT"
#####
##### Go back to master/parent pix directory again
#####
cd "/export/apps/www/${WEBSITE}/pix"
#####
##### End loop now
#####
done
################################################################
################################################################
################################################################
#####
##### Change ownership of all newly created files now ....
#####
if [ `pwd` = "/export/apps/www/${WEBSITE}/pix" ]
then
/bin/chown -R ${OWNER}:${GROUP} .
else
echo "Couldnt change ownership, because I am in `pwd`."
echo "Wouldnt be right to stamp with ${OWNER}:${GROUP} permissions."
echo "Exiting thru normal channels."
fi
#####
##### The end
#####
[root@turbo bin]#
pictures:*********:9999:550:Pictures User,,,:/export/apps/www/pictures:/bin/bash
##### ##### Generate slide shows for websites ##### - mine at midnight and every hour there after ##### 0 * * * * /usr/local/bin/create_slides.sh pluzzi
[root@turbo pix]# more index.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Paul A. Luzzi's Pictures</title> <META HTTP-EQUIV="REFRESH" CONTENT="0;URL=/cgi-bin/gen_pluzzi_index.sh"> </head> <body> <P> </body> </html> [root@turbo pix]#
[root@turbo pix]# cat /usr/local/apache/cgi-bin/gen_pluzzi_index.sh
#!/bin/ksh
#
#####
##### Written by Paul A. Luzzi on 12-21-2003
##### Purpose is to create an index of pix
#####
#####
##### Setup the location of the picture files.
#####
DATA_FILE_LOC="/export/apps/www/pluzzi/pix"
HOME_URL="http://www.bigdenmac.com/pluzzi/"
#####
##### Other vars
#####
MAX_ROW_COUNT="10"
#####
##### Setup the html page, header, title, etc
#####
echo "Content-type: text/html"
echo ""
echo ""
echo "<HTML>"
echo "<HEAD>"
echo "<TITLE>My Pictures</TITLE>"
echo "</HEAD>"
#####
##### Now put the form together for output to the screen.
#####
echo "<body TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000FF\" VLINK=\"#0000FF\" ALINK=\"#FF0000\" BACKGROUND=\"../../graphics/backgrnd.gif\">"
echo "<p>"
echo "<center><h1>My Pictures</h1></center>"
echo "<center><img SRC=\"../images/bar-med-black-blue.gif\" WIDTH=\"686\" HEIGHT=\"6\"></center>"
echo "<p>"
echo "<center>"
#####
##### Open the table ...
#####
COUNT="0"
echo "<CENTER>"
echo "<TABLE BORDER=1>"
echo " <TR valign=top>"
echo " <TD>"
echo " <TABLE border=1 cellpadding=5>"
#####
##### Loop thru all entries monitoring selection.
#####
cd $DATA_FILE_LOC
/bin/ls -1 | /bin/egrep -v "lost\+found|image_db.aid|archives|full_size|thumbs|index.html" | while read ENTRY
do
#####
##### Picture info
#####
ROW_NUM=`expr $COUNT + 1`
if [ "$ROW_NUM" -gt "$MAX_ROW_COUNT" ]
then
ROW_NUM="1"
echo " </TABLE>"
echo " </TD>"
echo " <TD>"
echo " <TABLE border=1 cellpadding=5>"
fi
INITIAL_DEST="${HOME_URL}pix/"
FINAL_DEST=`echo "$ENTRY" | /bin/sed -e "s/ /%20/g" -e s/\'/\\'/g -e s/\'/\\'/g `
DESTINATION="${INITIAL_DEST}${FINAL_DEST}/"
#####
##### Setup the "pretty print" title for the movie
#####
PRETTY_DEST=`echo "$ENTRY" | /bin/sed -e "s/_/ /g"`
#####
##### Setup the table entry
#####
echo " <TR>"
echo " <TD VALIGN=\"top\" ALIGN=CENTER>"
echo " <A HREF=\"${DESTINATION}\">${PRETTY_DEST}</A>"
echo " </TD>"
echo " </TR>"
#####
##### Update row counter
#####
COUNT="$ROW_NUM"
done
#####
##### Close table cell within a table
#####
echo " </TD>"
echo " </TR>"
echo " </TABLE>"
#####
##### Close the table
#####
echo " </TD></TR>"
echo "</TABLE>"
echo "</CENTER>"
echo "<P>"
echo "</center>"
echo "<center><img SRC=\"../images/bar-med-black-blue.gif\" WIDTH=\"686\" HEIGHT=\"6\"></center>"
echo "<center>"
## echo "<P><A href=\"JavaScript:history.back()\">Back</A>"
echo "<P><A href=\"../index.html\">Back</A>"
echo "</center>"
#####
##### Close the page
#####
echo "</FONT>"
echo "</BODY>"
echo "</HTML>"
[root@turbo pix]#
Thats it for the steps.
So with all that said, you now know how to automate this. With "winscp" loaded on each user's desktop, they just launch it, they know what password to put in to get access to their site, and that gets them to the Windows Explorer like interface. They can then just drag and drop from "my pictures" (on the left side, their local folders) to the "pix" folder (on the right side, the website folder). Note that I could even make this one step easier by making the "pix" folder be part of their home directory for the user, then they wouldnt even have to navigate anywhere in order to do drag-n-drop, but I didnt choose to do that because some users actually use NVu or WebPageMaker to build other pages.