- foreach($this->getAllTagPhotos() as $photo)
- {
- $images.= "<img src=\"phpfspot_img.php?idx=". $photo ."&width=". $this->cfg->thumb_width ."\" /><br />\n";
- }
+ $photos = $this->getAllTagPhotos();
+ $count = count($photos);
+
+ $rows = 0;
+ $cols = 0;
+ $images[$rows] = Array();
+
+ for($i = 0; $i < $count; $i++) {
+
+ $images[$rows][$cols] = $photos[$i];
+
+ if($cols == $this->cfg->thumbs_per_row-1) {
+ $cols = 0;
+ $rows++;
+ $images[$rows] = Array();
+ }
+ else {
+ $cols++;
+ }
+ }
+
+ // +1 for for smarty's selection iteration
+ $rows++;
+
+ //$images.= "<img src=\"phpfspot_img.php?idx=". $photo ."&width=". $this->cfg->thumb_width ."\" /><br />\n";