#! /bin/sh ############################################################################ # fotolist2html - Bourne Shell Skript to create an HTML index page for # # picture files # # # # Copyright (C) 1998-2005 Peter J. Weyers # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License version 2 as # # published by the Free Software Foundation. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # ############################################################################ # Setting some defaults: HTMLFILE=index.html DOCTITLE="Picture List" PAGETITLE="Picture List" PRG_NAME="fotolist2html" ICON_SUFFIX="_i.jpg" ORIG_SUFFIX=".orig" ICONLENGTH="140" TABCOLS="4" PICFILES="" DOS="" TEXTMODE="" TEXT_ASK="yes" COPYRIGHT="dEFAULT" while [ "$1" ] do case "$1" in -file) HTMLFILE="$2" shift 2 ;; -names) echo "Generating Name files" eval `/hb/www/bin/listhand /hb/www/lists/memberlist \ -search -picture . -mask "name picture" \ |sed -e "s/\([^ .][^ .]*\.[^ .][^ .]*\)/>\1.txt/g" \ -e "s/^\(.*\)$/echo \1;/g"` shift ;; -title) DOCTITLE="$2" PAGETITLE="$2" shift 2 ;; -cols) TABCOLS="$2" shift 2 ;; -iconsize) ICONLENGTH="$2" shift 2 echo -n "$PRG_NAME: Warning: Already existing pictures " >&2 echo "won't be remade!" >&2 ;; -imgwidth) IMGWIDTH="$2" shift 2 echo -n "$PRG_NAME: Warning: Already existing pictures " >&2 echo "won't be remade!" >&2 ;; -imgheight) IMGHEIGHT="$2" shift 2 echo -n "$PRG_NAME: Warning: Already existing pictures " >&2 echo "won't be remade!" >&2 ;; -dos) DOS="yes" shift 1 ;; -dontask) TEXT_ASK="no" shift 1 ;; -filesize) TEXTMODE=filesize shift 1 ;; -dummytext) DUMMYTEXT="$2" shift 2 ;; -quality) quality="-quality $2" shift 2 ;; -border) border='BORDER="'"$2"'"' shift 2 ;; -nocopyright) COPYRIGHT="nONE" shift 1 ;; -copyright) COPYRIGHT="$2" shift 2 ;; -y) YES="yes" shift ;; *$ICON_SUFFIX) echo "$PRG_NAME: skipping $1" shift ;; -?|-h|-help)echo "Usage: ${0##*/} [] file1 [file2 [file3 ...]]" echo "available options:" echo " -file Filename of HTML Document" echo " -title Title of HTML Document" echo " -cols Number of columns of HTML table" echo " -iconsize Width (or height) of thumbnail pictures" echo " -imgwidth Resize picture to that width (at max.)" echo " -imgheight Resize picture to that height (at max.)" echo " -border Value for border element of HTML img tag" echo " -names Create .txt files out of memberlist" echo " -dos Use ********.*** names for icons" echo " -dontask Don't ask for text. Use existing" echo " *.txt files only" echo " -dummytext Use instead of filename" echo " -y Implicitly answer yes (e.g to overwrite HTML file)" echo " -filesize Use filesize instead of filename" echo " -nocopyright Donīt include a copyright notice" echo " -copyright Add as copyright notice" echo exit ;; -*) echo "$PRG_NAME: unknown option: $1" >&2 exit ;; *) PICFILES="$PICFILES $1" shift ;; esac done counter=0 if [ -s "$HTMLFILE" ] then echo $PRG_NAME': File "'$HTMLFILE'" exists!' if [ foo"yes" == foo"$YES" ] then mv "$HTMLFILE" "$HTMLFILE"~ else rm -i "$HTMLFILE" fi fi if [ -s "$HTMLFILE" ] then echo $PRG_NAME': File "'$HTMLFILE'" not changed!!!!' else echo '' >> $HTMLFILE echo '' >> $HTMLFILE echo '' $DOCTITLE '' >> $HTMLFILE echo '' >> $HTMLFILE echo '' >> $HTMLFILE echo '' >> $HTMLFILE if [ -n "$PAGETITLE" ] ; then echo '

' $PAGETITLE '

' >> $HTMLFILE echo '
' >> $HTMLFILE fi # echo '' >> $HTMLFILE case "${COPYRIGHT}" in "nONE") ;; "dEFAULT") echo '
' >> $HTMLFILE echo 'Indexpage created by fotolist2html © 1998-2005 Peter J. Weyers' >> $HTMLFILE echo '
using ImageMagick' >> $HTMLFILE echo '© 1998 E. I. du Pont de Nemours and Company' >> $HTMLFILE echo '
' >> $HTMLFILE ;; "lINE") echo '' >> $HTMLFILE echo 'Indexpage created by fotolist2html © 1998-2005 Peter J. Weyers' >> $HTMLFILE echo 'using ImageMagick' >> $HTMLFILE echo '© 1998 E. I. du Pont de Nemours and Company' >> $HTMLFILE echo '' >> $HTMLFILE ;; *) echo '' >> $HTMLFILE echo '© '"$COPYRIGHT" >> $HTMLFILE echo '' >> $HTMLFILE ;; esac echo '
' >> $HTMLFILE echo '
' >> $HTMLFILE date +"%e-%b-%y" >> $HTMLFILE if [ -r $HOME/.2html_name ] ; then cat $HOME/.2html_name >> $HTMLFILE else echo $USER@`hostname` >> $HTMLFILE fi echo '
' >> $HTMLFILE echo '' >> $HTMLFILE echo $PRG_NAME': File "'$HTMLFILE'" created.' fi # $Id: fotolist2html,v 1.13 2006/12/18 22:26:42 peter Exp $