Download & Extend

Page numbers in gallery appear under the image info

Project:Image
Version:5.x-1.0
Component:image_gallery
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

On a new install with drupal 5.1 and image module version 5.x.-1.0 i've created several galleries, and filled these galleries with pictures (more then one page of pictures per gallery), the pictures contain no description or other info, just the title is filled in (with the filename).

When i (or others) browse the gallery, they notice that the page numbers and links to "first", "previous", "next" and "last" are located under the image info text, making it all very hard to read and use.

This has been confirmed with both Safari (Apple) as Firefox 2 (Linux & Apple), changing theme did not resolve the issue, the theme currently in use is garland.

See the screenshot for an illustration of the problem

AttachmentSizeStatusTest resultOperations
Schermafdruk.png262.09 KBIgnored: Check issue status.NoneNone

Comments

#1

I just tested the same module & layout with Internet Explorer, it's correct in IE, any suggestions on how to fix this (or even where to start looking) are welcome

#2

I found & fixed the problem for my setup, i had to change the theme_image_gallery function in the file image_gallery.module

It seems that the default added size of 75 pixels is not enough to include all text, IE autostretches the thing, but FireFox and Safari honour the set value's.

function theme_image_gallery($galleries, $images) {
  drupal_add_css(drupal_get_path('module', 'image_gallery') .'/image_gallery.css');

  // We'll add height to keep thumbnails lined up.  // Adding height to align them doesn't work for Firefox & safari
  $size = _image_get_dimensions('thumbnail');
  $width = $size['width'];
  // $height = $size['height']; (I won't be needing this variable)

  $content = '';
  if (count($galleries)) {
    $content.= '<ul class="galleries">';
    foreach ($galleries as $gallery) {
      $content .= '<li>';
      if ($gallery->count)
        $content.= l(image_display($gallery->latest, 'thumbnail'), 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE);
      $content.= "<h3>".l($gallery->name, 'image/tid/'.$gallery->tid) . "</h3>\n";
      $content.= '<div class="description">'. check_markup($gallery->description) ."</div>\n";
      $content.= '<p class="count">' . format_plural($gallery->count, 'There is 1 image in this gallery', 'There are @count images in this gallery') . "</p>\
n";
      if ($gallery->latest->changed) {
        $content.= '<p class="last">'. t('Last updated: %date', array('%date' => format_date($gallery->latest->changed))) . "</p>\n";
      }
      $content.= "</li>\n";
    }
    $content.= "</ul>\n";
  }

  if (count($images)) {
    // $height += 75;
    $content.= '<ul class="images">';
    foreach ($images as $image) {
      $content .= '<li';
      if ($image->sticky) {
        $content .= ' class="sticky"';
      }
      $content .= ' style="width : '.$width.'px;"';
      $content .= ">\n";
      $content .= l(image_display($image, 'thumbnail'), 'node/'.$image->nid, array(), NULL, NULL, FALSE, TRUE);
      $content .= '<h3>'.l($image->title, 'node/'.$image->nid)."</h3>";
      if (theme_get_setting('toggle_node_info_' . $image->type)) {
        $content .= '<div class="author">'. t('Posted by: !name', array('!name' => theme('username', $image))) . "</div>\n";
        if ($image->created > 0) {
          $content .= '<div class="date">'.format_date($image->created)."</div>\n";
        }
      }
      $content .= "</li>\n";
    }
    $content.= "</ul>\n";
  }

  if ($pager = theme('pager', NULL, variable_get('image_images_per_page', 6), 0)) {
    $content.= $pager;
  }

  If (count($images) + count($galleries) == 0) {
      $content.= '<p class="count">' . format_plural(0, 'There is 1 image in this gallery', 'There are @count images in this gallery') . "</p>\n";
  }

  return $content;
}

#3

Status:active» fixed

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.