cristiansans (owner)

Revisions

gist: 185631 Download_button fork
public
Public Clone URL: git://gist.github.com/185631.git
Embed All Files: show embed
singlepic.php patch (next gen gallery) #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Next Gen Gallery hacks for ibai's web
 
<?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?>
 
<?php if (is_home() | (is_category('pictures'))) : ?>
<a href="<?php the_permalink() ?>">
<img class="<?php echo $image->classname ?>" src="<?php echo $image->thumbnailURL ?>" alt="<?php echo $image->alttext ?>" title="<?php echo $image->alttext ?>" />
</a>
<?php else: ?>
<a href="<?php echo $image->imageURL ?>" <?php echo $image->thumbcode ?> >
<img class="<?php echo $image->classname ?>" src="<?php echo $image->thumbnailURL ?>" alt="<?php echo $image->alttext ?>" title="<?php echo $image->alttext ?>" />
</a>
<?php endif; ?>
<?php if (!empty ($image->caption)) : ?><span><?php echo $image->caption ?></span><?php endif; ?>
<?php endif; ?>
 
 
 
//ngg-functions.php line 710
 
//**
 * nggShowRelatedGallery() - create a gallery based on the tags
 *
 * @access public
 * @param string $taglist list of tags as csv
 * @param integer $maxImages (optional) limit the number of images to show
 * @return the content
 */
function nggShowRelatedGallery($taglist, $maxImages = 0) {
 
$ngg_options = nggGallery::get_option('ngg_options');
 
// get now the related images
$picturelist = nggTags::find_images_for_tags($taglist, 'RAND');
 
// go on if not empty
if ( empty($picturelist) )
return;
 
// cut the list to maxImages
if ( $maxImages > 0 )
array_splice($picturelist, $maxImages);
 
  // *** build the gallery output
$out = '<ul class="ngg-related-gallery">';
foreach ($picturelist as $picture) {
 
// get the effect code
$thumbcode = $picture->get_thumbcode( __('Related images for', 'nggallery') . ' ' . get_the_title());
 
$out .= '<li><a href="' . $picture->imageURL . '" title="' . stripslashes(nggGallery::i18n($picture->description)) . '" ' . $thumbcode . ' rel="set">';
$out .= '<img title="' . stripslashes(nggGallery::i18n($picture->alttext)) . '" alt="' . stripslashes(nggGallery::i18n($picture->alttext)) . '" src="' . $picture->thumbURL . '" />';
$out .= '</a><h3>' . $picture->title . '</h3><em><a href="' . $picture->imageURL . '" class="thickbox" rel="set">' . $picture->alttext . '</a></em></li>' . "\n";
}
$out .= '</ul>' . "\n";
 
$out = apply_filters('ngg_show_related_gallery_content', $out, $taglist);
 
return $out;
}
 
 
// /view/gallery.php line 40
 
<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $gallery->imagewidth ?> >
<div class="ngg-gallery-thumbnail" >
<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> rel="set">
<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
</a>
</div>
</div>