head 1.3; access; symbols; locks georg:1.3; strict; comment @# @; 1.3 date 2003.02.25.16.03.54; author georg; state Exp; branches; next 1.2; 1.2 date 2003.02.25.15.34.08; author georg; state Exp; branches; next 1.1; 1.1 date 2003.02.25.10.15.48; author georg; state Exp; branches; next ; desc @more or less complete rewrite @ 1.3 log @name/file fix @ text @config=&$config; $this->name=$file; $this->file=$config->imagedir . "/" .$file; $this->orig=$config->origdir . "/" .$file; $this->thumb=$config->thumbdir. "/" .$file; $this->ufile=$config->uimagedir . "/" . rawurlencode($file); $this->uorig=$config->uorigdir . "/" . rawurlencode($file); $this->uthumb=$config->uthumbdir . "/" . rawurlencode($file); if ($this->filesize=GetImagesize($this->file)) $valid_file=true; else echo "
WARNING: $this->file (orig) does not work!
\n"; if ($this->thumbsize=GetImagesize($this->thumb)) $valid_thumb=true; else echo "
WARNING: $this->thumb (thumbnail) does not work!
\n"; if ($config->imagedir != $config->origdir) { if ($this->origsize = GetImagesize($this->orig)) $valid_orig=true; else echo "
WARNING: $this->file (orig) does not work!
\n"; } else $this->origsize=$this->filesize; if ($valid_file and $valid_orig and $valid_thumb) $this->valid=true; else $this->valid=false; if (eregi($config->filename_regex, $file, $result)) $this->alt=$result[2]; else { $this->alt=false; if ($config->debug) echo "
WARNING: NO ALT TAG match!
\n"; } } function image_td () { $config=&$this->config; $out=""; $out .= ''; $out .= ''; $out .= 'alt) $out .= ' alt="' . $this->alt . '"'; $out .= ' border="0">' . "\n"; return $out; } function text_td () { $out=""; $out .= ''; $out .= ''; if ($this->alt) $out .= $this->alt; else $out .= "big"; $out .= '' . "\n"; echo $out; } function compare (&$a,&$b) { return strcasecmp ( $a->name , $b->name ) ; } function getOrigHeight() { return $this->origsize[1]; } function getOrigStr() { return $this->origsize[3]; } function getOrigWidth() { return $this->origsize[0]; } function getFileHeight() { return $this->filesize[1]; } function getFileStr() { return $this->filesize[3]; } function getFileWidth() { return $this->filesize[0]; } function getThumbHeight() { return $this->thumbsize[1]; } function getThumbStr() { return $this->thumbsize[3]; } function getThumbWidth() { return $this->thumbsize[0]; } } class sizePic extends Pic { function compare (&$a,&$b) { if ( $a->getOrigWidth() == $b->getOrigWidth() ) return 0; return ( $a->getOrigWidth() > $b->getOrigWidth() ? -1 : 1); } function text_td () { $out=""; $out .= ''; $out .= ''; if ($this->alt) $out .= $this->alt; else $out .= $this->getOrigWidth() . "x" . $this->getOrigHeight(); $out .= '' . "\n"; echo $out; } } class Pic_Javascript extends Pic { function image_td () { $config=&$this->config; $out=""; $out .= ''; $out .= 'viewer . "?file=" . base64_encode($this->file); $out .= "&width=" . $this->getFileWidth(); $out .= "&height=" . $this->getFileHeight(); $out .= "'," . $this->getFileWidth() . "," . $this->getFileHeight() . ')">'; $out .= 'alt) $out .= ' alt="' . $this->alt . '"'; $out .= " " . $this->getThumbStr(); $out .= ' border="0">' . "\n"; return $out; } } class sizeJavaPic extends sizePic { // should be a copy from above, but php does not support multiple // inheritance function image_td () { $config=&$this->config; $out=""; $out .= ''; $out .= 'viewer . "?file=" . base64_encode($this->file); $out .= "&width=" . $this->getFileWidth(); $out .= "&height=" . $this->getFileHeight(); $out .= "'," . $this->getFileWidth() . "," . $this->getFileHeight() . ')">'; $out .= 'alt) $out .= ' alt="' . $this->alt . '"'; $out .= " " . $this->getThumbStr(); $out .= ' border="0">' . "\n"; return $out; } } ?> @ 1.2 log @no alt at all @ text @d10 1 d30 1 a30 1 if (eregi($config->filename_regex, $this->file, $result)) d62 1 a62 2 if ( $a->file == $b->file ) return 0; return ( $a->file > $b->file ? -1 : 1) ; @ 1.1 log @Initial revision @ text @a35 9 // echo $this->getOrigHeight() . "\n" ; // echo $this->getOrigStr() . "\n" ; // echo $this->getOrigWidth() . "\n" ; // echo $this->getFileHeight() . "\n" ; // echo $this->getFileStr() . "\n" ; // echo $this->getFileWidth() . "\n" ; // echo $this->getThumbHeight() . "\n" ; // echo $this->getThumbStr() . "\n" ; // echo $this->getThumbWidth() . "\n" ; d101 2 a102 1 $out .= 'getFileWidth() . "," . $this->getFileHeight(); $out .= ')">' . $this->alt . 'getThumbStr(); d114 1 d122 2 a123 1 $out .= 'getFileWidth() . "," . $this->getFileHeight(); $out .= ')">' . $this->alt . 'getThumbStr(); a134 1 @