Permalink
Browse files

Added Thumbs for galleryii of images

  • Loading branch information...
1 parent f384658 commit e8bfd417c5aa02466a288f083196d571c6bde29f @sensorario committed Sep 27, 2011
Showing with 8 additions and 4 deletions.
  1. +2 −2 lyiightbox/Galleryii.php
  2. +6 −2 lyiightbox/LyiightBox2.php
View
@@ -23,6 +23,7 @@ class Galleryii extends ConfigWidget {
public $baseFolder = '/images/galleryii';
public $thumbnails = '/thumbnails';
public $images = '/images';
+ public $thumbSide = 120;
private function showHelpPage() {
echo ""
@@ -49,8 +50,7 @@ private function showThumbnails() {
$countImages = 0;
while ($image = readdir($dirHandle))
if (!in_array($image, array('.', '..')))
- LyiightBox2::thumb($this, $image);
- echo $countImages;
+ LyiightBox2::thumb($this, $image, $this->thumbSide);
closedir($dirHandle);
}
@@ -50,13 +50,17 @@ public function init() {
$this->printLink();
}
- public static function thumb(Galleryii $galleryii, $image) {
+ public static function thumb(Galleryii $galleryii, $image, $width = 120) {
+ echo "<div style=\"width: ".($width+3)."px; height: ".($width+30+3)."px; margin: 3px; border: #ccc 1px solid; float: left; \">";
+ echo "<div style=\"width: $width; height: $width; margin: 3px; border: #ccc 1px solid;\">";
echo '<a '
. 'href="' . "{$galleryii->rootFolder}{$galleryii->baseFolder}{$galleryii->images}/{$image}" . '" '
. 'rel="lightbox[galleryii]" '
. '>'
- . '<img src="'."{$galleryii->rootFolder}{$galleryii->baseFolder}{$galleryii->thumbnails}/{$image}".'">'
+ . '<img src="'."{$galleryii->rootFolder}{$galleryii->baseFolder}{$galleryii->thumbnails}/{$image}".'" style="width: 100%;">'
. '</a>';
+ echo "</div>";
+ echo "</div>";
}
}

0 comments on commit e8bfd41

Please sign in to comment.