| 1 |
<?php
|
| 2 |
|
| 3 |
// Uncomment this if you are not using the lightbox.js in the page.tpl.php file.
|
| 4 |
// drupal_set_html_head('<script type="text/javascript" src="themes/meta/js/lightbox.js"></script>');
|
| 5 |
|
| 6 |
$size = _image_get_dimensions('thumbnail');
|
| 7 |
$width = $size['width'];
|
| 8 |
$height = $size['height'];
|
| 9 |
|
| 10 |
|
| 11 |
$content = '';
|
| 12 |
if (count($galleries)) {
|
| 13 |
$content.= "\n".'<div id="galleries">'."\n";
|
| 14 |
$content.= "\t".'<ul>'."\n";
|
| 15 |
foreach ($galleries as $gallery) {
|
| 16 |
// Finding out the width of an image being used. Sould be 90x68 or 68x90 pixels.
|
| 17 |
$metaglryimg = image_get_info(file_create_path($gallery->latest->images['thumbnail']));
|
| 18 |
$metaglryimgwdth = $metaglryimg[width];
|
| 19 |
// Start setting the mood...
|
| 20 |
if ($gallery->count)
|
| 21 |
$content .= "\t"."\t".'<li class="clearfix">'."\n";
|
| 22 |
$content .= "\t"."\t"."\t".'<div class="preview">';
|
| 23 |
// Is it horizontal?
|
| 24 |
if ($metaglryimgwdth=='90') {
|
| 25 |
$content.= '<span class="horiz">';
|
| 26 |
}
|
| 27 |
// Is it vertical? Or to be safe, not horizontal?
|
| 28 |
if ($metaglryimgwdth!='90') {
|
| 29 |
$content.= '<span class="vert">';
|
| 30 |
}
|
| 31 |
$content.= l(image_display($gallery->latest, 'thumbnail'), 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE);
|
| 32 |
$content.= "</span>"."</div>"."\n";
|
| 33 |
$content.= "\t"."\t"."\t".'<div class="preview-desc">'."\n";
|
| 34 |
$content.= "\t"."\t"."\t"."\t"."<h2>".l($gallery->name, 'image/tid/'.$gallery->tid) . "</h2>\n";
|
| 35 |
$content.= "\t"."\t"."\t"."\t".'<div class="description">'. check_markup($gallery->description) ."</div>\n";
|
| 36 |
$content.= "\t"."\t"."\t"."\t".'<span class="count">' . format_plural($gallery->count, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "</span>".'<br />'."\n";
|
| 37 |
if ($gallery->latest->changed) {
|
| 38 |
$content.= "\t"."\t"."\t"."\t".'<span class="last">'. t('Last updated: %date', array('%date' => format_date($gallery->latest->changed))) . "</span>".'<br />'."\n";
|
| 39 |
}
|
| 40 |
$content.= "\t"."\t"."\t"."\t".'<span class="view-button">'.l('<img src="themes/meta/images/gallery-viewbutton.gif" alt="View Gallery" title="View This Gallery" />', 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE) .'</span>'.'<br />'."\n";
|
| 41 |
$content.= "\t"."\t"."\t"."</div>\n";
|
| 42 |
$content.= "\t"."\t"."</li>\n";
|
| 43 |
}
|
| 44 |
$content.= "\t"."</ul>\n";
|
| 45 |
$content.= "</div>\n";
|
| 46 |
}
|
| 47 |
|
| 48 |
|
| 49 |
if (count($images)) {
|
| 50 |
$content.= "\n".'<div id="gallery">'."\n";
|
| 51 |
$content.= "\t".'<ul>'."\n";
|
| 52 |
foreach ($images as $image) {
|
| 53 |
// Finding out the width of an image being used. Sould be 90x68 or 68x90 pixels.
|
| 54 |
$metaimg = image_get_info(file_create_path($image->images['thumbnail']));
|
| 55 |
$metaimgwdth = $metaimg[width];
|
| 56 |
// Start setting the mood...
|
| 57 |
$content.= "\t"."\t"."<li";
|
| 58 |
if ($image->sticky) {
|
| 59 |
$content.= ' class="sticky"';
|
| 60 |
}
|
| 61 |
$content.= ">\n";
|
| 62 |
// If you want to go to the node and not use lightbox, use this line instead of the one below.
|
| 63 |
/* $content .= "\t"."\t"."\t".'<h3>'.l($image->title, 'node/'.$image->nid)."</h3>"."\n"; */
|
| 64 |
// If you want to go to the image using lightbox, use this line instead of the one above.
|
| 65 |
$content.= "\t"."\t"."\t".'<h3>'.l($image->title, 'image/view/'.$image->nid, array('rel' => 'lightbox[gallery]', 'title' => $image->body))."</h3>"."\n";
|
| 66 |
$content.= "\t"."\t"."\t";
|
| 67 |
// Is it horizontal?
|
| 68 |
if ($metaimgwdth=='90') {
|
| 69 |
$content.= '<span class="horiz">';
|
| 70 |
}
|
| 71 |
// Is it vertical? Or to be safe, not horizontal?
|
| 72 |
if ($metaimgwdth!='90') {
|
| 73 |
$content.= '<span class="vert">';
|
| 74 |
}
|
| 75 |
// If you want to go to the node and not use lightbox, use this line instead of the one below.
|
| 76 |
/* $content .= l(image_display($image, 'thumbnail'), 'node/'.$image->nid, array(), NULL, NULL, FALSE, TRUE); */
|
| 77 |
// If you want to go to the image using lightbox, use this line instead of the one above.
|
| 78 |
$content.= l(image_display($image, 'thumbnail'), 'image/view/'.$image->nid, array('rel' => 'lightbox[gallery]', 'title' => $image->body), NULL, NULL, FALSE, TRUE);
|
| 79 |
$content.= "</span>";
|
| 80 |
$content.= "\n";
|
| 81 |
if (theme_get_setting('toggle_node_info_' . $image->type)) {
|
| 82 |
$content.= "\t"."\t"."\t".'<div class="date">'.format_date($image->created, 'small')."</div>\n";
|
| 83 |
}
|
| 84 |
$content.= "\t"."\t"."</li>\n";
|
| 85 |
}
|
| 86 |
$content.= "\t"."</ul>\n";
|
| 87 |
$content.= "</div>\n";
|
| 88 |
}
|
| 89 |
|
| 90 |
|
| 91 |
if ($pager = theme('pager', NULL, variable_get('image_images_per_page', 6), 0)) {
|
| 92 |
$content.= $pager;
|
| 93 |
}
|
| 94 |
|
| 95 |
If (count($images) + count($galleries) == 0) {
|
| 96 |
$content.= '<p class="count">' . format_plural(0, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "</p>\n";
|
| 97 |
}
|
| 98 |
|
| 99 |
print $content;
|
| 100 |
|
| 101 |
|
| 102 |
?>
|
| 103 |
|