-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinc_print_image_thumb.php
92 lines (91 loc) · 4.04 KB
/
inc_print_image_thumb.php
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<div class="row image-wrap margin-bottom-double">
<?php while (next_image()) { ?>
<?php
$fullimage = getFullImageURL();
$isImagePhoto = isImagePhoto($_zp_current_image);
$isImageVideo = isImageVideo($_zp_current_image);
$isAudio = false;
if ($isImageVideo) {
$suffix = strtolower(getSuffix($_zp_current_image->getFileName()));
if ($suffix == 'mp3' || $suffix == 'm4a') {
$isAudio = true;
}
}
$objectclass = strtolower(get_class($_zp_current_image));
$isTextObject = false;
if ($objectclass == 'textobject') {
$isTextObject = true;
$isEmbedVideo = false;
$link = zpB_getLink($_zp_current_image->getContent());
if ($link) {
$isEmbedVideo = true;
}
}
?>
<?php if (!empty($fullimage)) { ?>
<div class="col-xs-6 col-sm-3 image-thumb">
<?php // image file
if ($isImagePhoto) { ?>
<a class="thumb" href="<?php echo html_encode(pathurlencode($fullimage)); ?>" title="<?php echo html_encode(getBareImageTitle()); ?>" data-fancybox="images">
<?php printImageThumb(getBareImageTitle(), 'remove-attributes img-responsive'); ?>
<div class="hidden caption">
<h4><?php printBareImageTitle(); ?></h4>
<?php echo printImageDesc(); ?>
</div>
</a>
<?php // audio file
} else if ($isImageVideo && $isAudio) { ?>
<a class="thumb" href="javascript:;" data-type="iframe" data-src="<?php echo html_encode(pathurlencode($fullimage)); ?>" title="<?php echo html_encode(getBareImageTitle()); ?>" data-fancybox="images">
<?php printImageThumb(getBareImageTitle(), 'remove-attributes img-responsive'); ?>
<div class="hidden caption">
<h4><?php printBareImageTitle(); ?></h4>
<?php echo printImageDesc(); ?>
</div>
</a>
<?php // video file
} else if ($isImageVideo && !$isAudio) { ?>
<a class="thumb" href="<?php echo html_encode(pathurlencode($fullimage)); ?>" title="<?php echo html_encode(getBareImageTitle()); ?>" data-fancybox="images">
<?php printImageThumb(getBareImageTitle(), 'remove-attributes img-responsive'); ?>
</a>
<div class="hidden caption">
<h4><?php printBareImageTitle(); ?></h4>
<?php echo printImageDesc(); ?>
</div>
<?php // embed online video (hack of textobject)
} else if ($isTextObject && $isEmbedVideo) { ?>
<a class="thumb" href="<?php echo html_encode(pathurlencode($link)); ?>" title="<?php echo html_encode(getBareImageTitle()); ?>" data-fancybox="images">
<?php printImageThumb(getBareImageTitle(), 'remove-attributes img-responsive'); ?>
<div class="hidden caption">
<h4><?php printBareImageTitle(); ?></h4>
<?php echo printImageDesc(); ?>
</div>
</a>
<?php // txt, htm or html content
} else if ($isTextObject && !$isEmbedVideo) { ?>
<a class="thumb" href="javascript:;" data-src="#item<?php echo $_zp_current_image->getIndex(); ?>" title="<?php echo html_encode(getBareImageTitle()); ?>" data-fancybox="images">
<?php printImageThumb(getBareImageTitle(), 'remove-attributes img-responsive'); ?>
<div class="hidden caption">
<h4><?php printBareImageTitle(); ?></h4>
<?php echo printImageDesc(); ?>
</div>
</a>
<div style="display: none;" id="item<?php echo $_zp_current_image->getIndex();?>">
<?php echo $_zp_current_image->getContent(); ?>
</div>
<?php // other media object not displayed in fancybox
} else { ?>
<a class="thumb" href="<?php echo html_encode(pathurlencode($fullimage)); ?>" title="<?php echo html_encode(getBareImageTitle()); ?>">
<?php printImageThumb(getBareImageTitle(), 'remove-attributes img-responsive'); ?>
<div class="hidden caption">
<h4><?php printBareImageTitle(); ?></h4>
<?php echo printImageDesc(); ?>
</div>
</a>
<?php } ?>
<a href="<?php echo html_encode(getImageURL()); ?>" title="<?php echo html_encode(getBareImageTitle()); ?>">
<h5><?php printBareImageTitle(); ?></h5>
</a>
</div>
<?php } ?>
<?php } ?>
</div>