summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r--phpfspot.class.php45
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++;