head 1.10; access; symbols; locks georg:1.10; strict; comment @# @; 1.10 date 2004.11.12.12.49.58; author georg; state Exp; branches; next 1.9; 1.9 date 2003.02.25.10.15.48; author georg; state Exp; branches; next 1.8; 1.8 date 2002.08.21.13.42.47; author georg; state Exp; branches; next 1.7; 1.7 date 2002.07.12.16.45.14; author georg; state Exp; branches; next 1.6; 1.6 date 2002.07.11.15.47.46; author georg; state Exp; branches; next 1.5; 1.5 date 2002.07.10.19.35.50; author georg; state Exp; branches; next 1.4; 1.4 date 2001.07.29.09.21.40; author georg; state Exp; branches; next 1.3; 1.3 date 2001.07.28.22.42.33; author georg; state Exp; branches; next 1.2; 1.2 date 2001.07.28.21.54.54; author georg; state Exp; branches; next 1.1; 1.1 date 2001.07.28.20.55.12; author georg; state Exp; branches; next ; desc @init @ 1.10 log @*** empty log message *** @ text @title="Photo Gallery"; $config->be_notext=false; // print a line below the Picture $config->be_nopix=false; // for testing purposes, do not print the image lines $config->imagedir="img"; // normal size images $config->origdir="orig"; // big images, clicks in the text line $config->thumbdir="thu"; $config->thumbsize=250; $config->pixperline=4; $config->cellpadding=1; $config->ispicture_regex='\.(jpg|gif)$'; // $2 is the optional alt-tag $config->filename_regex='^([[:digit:]]{2}) (.*)' . $config->ispicture_regex; // Pic sortiert nach Namen, // sizePic nach Groesse // Pic_Javascript braucht man wenn der javascript viewer verwendet wird // sizeJavaPic, wie oben, nach Grösse $config->pictype="Pic"; $config->viewer="viewer.php"; $config->javascript=false; init(); ?> <?php echo $config->title; ?>

title; ?>

tablewidth; ?> cellpadding=cellpadding; ?>>
@ 1.9 log @more or less complete rewrite @ text @d4 1 a4 1 $config->title="Luise Helm"; d10 2 a11 2 $config->thumbsize=150; $config->pixperline=5; d13 1 a13 1 $config->ispicture_regex='\.jpg$'; d15 6 a20 3 $config->filename_regex='^[[:digit:]]{3}' . $config->ispicture_regex; $config->pictype="SizePic"; $config->pictype="SizeJavaPic"; d22 1 a22 1 $config->javascript=true; @ 1.8 log @added comments @ text @d1 20 a20 140 origSize=GetImageSize("$imagedir/$file") and $this->thumbSize=GetImageSize("$thumbdir/$file")) { $this->valid=true; } else { $this->valid=false; } if ($this->valid) { $this->file=$file; $this->ufile=rawurlencode($file); if (eregi($filename_regex, $this->file, $result)) { $this->alt=$result[2]; } else { $this->alt=""; } } else { echo "
WARNING: $file does not work!
\n"; } } function print_image_td () { global $be_big; if ( ! $be_big) { $this->print_jimage_td (); // javascript } else { $this->print_bimage_td (); // no javascript } } // click on the picture does not open a new browser window function print_bimage_td () { global $ubigdir, $uthumbdir, $viewer, $imagedir; $out=""; $out .= 'ufile; $out .= '" alt="' . $this->alt . '" '; $out .= $this->getThumbStr(); $out .= ' border="0">' . "\n"; echo $out; } // clock on the picture opens a javascirtp window function print_jimage_td () { global $uimagedir, $uthumbdir, $viewer, $imagedir; $out=""; $out .= 'getOrigWidth() . "," . $this->getOrigHeight(); $out .= ')">ufile; $out .= '" alt="' . $this->alt . '" '; $out .= $this->getThumbStr(); $out .= ' border="0">' . "\n"; echo $out; } function print_text_td () { global $uimagedir, $uthumbdir, $viewer, $imagedir; $out=""; $out .= ''; $out .= $this->alt; $out .= '' . "\n"; echo $out; } function getOrigHeight() { return $this->origSize[1]; } function getOrigStr() { return $this->origSize[3]; } function getOrigWidth() { return $this->origSize[0]; } function getThumbHeight() { return $this->thumbSize[1]; } function getThumbStr() { return $this->thumbSize[3]; } function getThumbWidth() { return $this->thumbSize[0]; } } function writeLine (&$arr,$start,$num) { global $be_verbose, $be_nopix; $end=$start+$num; if (!$be_nopix) { echo "\n"; for ($i = $start ; $i < $end ; $i++) { $arr[$i]->print_image_td(); } echo "\n"; } if ($be_verbose) { echo "\n"; for ($i = $start ; $i < $end ; $i++) { $arr[$i]->print_text_td(); } echo "\n"; } } function compare (&$a,&$b) { if ( $a->file == $b->file ) return 0; return ( $a->file < $b->file ) ? -1 : 1; } $listdir=getcwd() . "/" . $imagedir; $dir = opendir($listdir); $files=array(); $counter=0; while($file = readdir($dir)) { if (eregi($ispicture_regex, $file)) { $files[]=new Pic($file); $counter += 1; } } closedir($dir); usort($files,"compare"); reset ($files); d25 1 a25 1 a26 11 d28 2 a29 3 d32 1 a32 1 d34 2 a35 19 cellpadding=> GetThumbFile(); // echo $xy . "
\n"; // } // matches the very first "if" ?> @ 1.7 log @big implemented @ text @d2 1 a2 1 $title="Sonnwendfeuer 2002"; d4 1 a4 1 $be_nopix=false; d10 1 a10 1 $pixperline=2; d54 1 a54 1 $this->print_jimage_td (); d57 1 a57 1 $this->print_bimage_td (); d60 2 a61 1 function print_bimage_td () { d72 1 @ 1.6 log @writeline fixed. @ text @d2 2 a3 2 $title="Jürg am Athos zu Ostern 2002"; $be_verbose=true; // write filenames extra d5 1 a5 1 $be_big=false; //TODO d8 1 a8 1 $bigdir; d10 1 a10 1 $pixperline=4; d60 11 @ 1.5 log @massive cleanup , better oo base64 encodings switchable comment @ text @d4 1 d92 1 a92 1 global $be_verbose; d94 6 a99 3 echo "\n"; for ($i = $start ; $i < $end ; $i++) { $arr[$i]->print_image_td(); d102 1 a102 1 echo "\n"; d106 1 a107 1 echo "\n"; @ 1.4 log @better regex for alt tag @ text @d2 39 a40 24 $imagedir="img"; $thumbdir="small"; $bigdir="roll"; $thumbsize=170; $pixperline=3; $cellpadding=5; $title="Walters 70er in der Hagenau"; $big=$HTTP_GET_VARS["orig"]; if ($big == "yes") $imagedir=$bigdir; $uimagedir=$imagedir; // rawurlencode if necessary $viewer="viewer.php"; $tablewidth=$thumbsize*$pixperline+($pixperline-1)*$cellpadding; Class Pic { var $origFile=""; var $origSize=array(); var $thumbFile=""; var $thumbSize=array(); function setOrigFile($file) { $this->origFile=$file; d42 2 a43 44 function setOrigSize($arr) { $this->origSize=$arr; } function getOrigFile() { return $this->origFile; } function getOrigWidth() { return $this->origSize[0]; } function getOrigHeight() { return $this->origSize[1]; } function getOrigStr() { return $this->origSize[3]; } // thumbs function setThumbFile($file) { $this->thumbFile=$file; } function setThumbSize($arr) { $this->thumbSize=$arr; } function getThumbFile() { return $this->thumbFile; } function getThumbWidth() { return $this->thumbSize[0]; } function getThumbHeight() { return $this->thumbSize[1]; } function getThumbStr() { return $this->thumbSize[3]; d46 55 a100 33 function writeLine ($arr,$start,$num) { global $viewer; global $uimagedir; $end=$start+$num; echo "\n"; for ($i = $start ; $i < $end ; $i++) { echo "\n"; } echo "\n"; d102 22 a123 29 $listdir=getcwd() . "/$imagedir"; if ($dir = opendir($listdir)) { $files=array(); $a=array(); $b=array(); $counter=0; while($file = readdir($dir)) { if (ereg("^[^\.].*(\.jpg|\.gif)$", $file)) { //echo "$file matched
"; $ufile=rawurlencode($file); if ($a=@@GetImageSize("$imagedir/$file") and $b=@@GetImageSize("$thumbdir/$file")) { $files[$counter] = new Pic; $files[$counter]->setOrigFile("$ufile"); $files[$counter]->setOrigSize($a); $files[$counter]->setThumbFile("$thumbdir/$ufile"); $files[$counter]->setThumbSize($b); $counter += 1; } else echo "$imagedir/$file
"; } } closedir($dir); sort($files); reset ($files); a139 13 d166 1 a166 1 } // matches the very first "if" @ 1.3 log @alt instead of line with picture names @ text @d3 1 a3 1 $thumbdir="thumbs"; d5 2 a6 2 $thumbsize=165; $pixperline=4; d8 1 a8 1 $title="Gromas 90er"; d97 2 a98 2 if (ereg("^[0-9]* ?([^\.].*)\.(jpg|gif)$", rawurldecode($arr[$i]->getOrigFile()), $result)) echo $result[1]; d100 2 a101 2 echo "Picture"; echo "\""; @ 1.2 log @nice moving @ text @d4 1 d6 1 a6 1 $pixperline=2; d9 3 d81 1 a81 1 echo "\n"; } echo "\n"; echo "\n"; for ($i = $start ; $i < $end ; $i++) { echo "\n"; d147 2 a148 1 this.viewer.close(); d152 1 a152 1 // d164 1 a164 1 // @ 1.1 log @Initial revision @ text @d159 6 a164 14 blah=0; function show(file,x,y) { if (blah.innerWidth) { blah.innerWidth=x; blah.innerHeight=y; blah.location=file; } else { gross="width="+String(x)+",height="+String(y); blah = window.open(file,'viewer',gross); } blah.focus(); d166 13 a178 1 @
"; echo "getOrigWidth() ; echo $schas; echo ","; $schas=$arr[$i]->getOrigHeight(); echo $schas; echo ")\">getThumbFile() ; echo $schas; echo "\" alt=\""; if (ereg("^([0-9]+ )(.*)(\.jpg|\.gif)$", rawurldecode($arr[$i]->getOrigFile()), $result)) echo $result[2]; else echo "click!"; echo "\" "; $schas=$arr[$i]->getThumbStr() ; echo $schas; echo " border=\"0\" align=\"center\">
"; d96 2 a97 23 echo "\" "; $schas=$arr[$i]->getThumbStr() ; echo $schas; echo " border=\"0\" align=\"center\">
"; echo "getOrigWidth() ; echo $schas; echo ","; $schas=$arr[$i]->getOrigHeight(); echo $schas; echo ")\">"; if (ereg("^([^\.].*)\.(jpg|gif)$", rawurldecode($arr[$i]->getOrigFile()), $result)) d101 3 a103 1 echo "