diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2007-12-30 18:24:27 +0100 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2007-12-30 18:24:27 +0100 |
commit | d4e3972681b66912c5594c9021b06eb73585c80a (patch) | |
tree | f8d4f402eca0210bee07421a5a8a3d655f14c6b7 /phpfspot.class.php | |
parent | 0b99d3d170ab3d975c73b1ddc3ee83506f3843ba (diff) |
issue84, don't try to display not existing pictures
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r-- | phpfspot.class.php | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index 4b60743..d5eb970 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -926,30 +926,33 @@ class PHPFSPOT { for($i = $begin_with; $i < $end_with; $i++) { - $images[$rows][$cols] = $photos[$i]; - $img_id[$rows][$cols] = $i; - $img_name[$rows][$cols] = htmlspecialchars($this->getPhotoName($photos[$i], 15)); - $img_title[$rows][$cols] = "Click to view photo ". htmlspecialchars($this->getPhotoName($photos[$i], 0)); + if(isset($photos[$i])) { - $thumb_path = $this->get_thumb_path($this->cfg->thumb_width, $photos[$i]); + $images[$rows][$cols] = $photos[$i]; + $img_id[$rows][$cols] = $i; + $img_name[$rows][$cols] = htmlspecialchars($this->getPhotoName($photos[$i], 15)); + $img_title[$rows][$cols] = "Click to view photo ". htmlspecialchars($this->getPhotoName($photos[$i], 0)); - if(file_exists($thumb_path)) { - $info = getimagesize($thumb_path); - $img_width[$rows][$cols] = $info[0]; - $img_height[$rows][$cols] = $info[1]; - } + $thumb_path = $this->get_thumb_path($this->cfg->thumb_width, $photos[$i]); - if($cols == $this->cfg->thumbs_per_row-1) { - $cols = 0; - $rows++; - $images[$rows] = Array(); - $img_width[$rows] = Array(); - $img_height[$rows] = Array(); - } - else { - $cols++; - } - } + if(file_exists($thumb_path)) { + $info = getimagesize($thumb_path); + $img_width[$rows][$cols] = $info[0]; + $img_height[$rows][$cols] = $info[1]; + } + + if($cols == $this->cfg->thumbs_per_row-1) { + $cols = 0; + $rows++; + $images[$rows] = Array(); + $img_width[$rows] = Array(); + $img_height[$rows] = Array(); + } + else { + $cols++; + } + } + } // +1 for for smarty's selection iteration $rows++; |