summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-05-25 19:27:18 +0200
committerAndreas Gohr <andi@splitbrain.org>2006-05-25 19:27:18 +0200
commit0b173dce41bf258bf8d4bb1ca3e53064521e5cf2 (patch)
treee66f7fd18e8474202b9d04b2504a2982e58ae840
parent256ca81eb29f12a492c2354729a7b36d47cafdb6 (diff)
downloadrpg-0b173dce41bf258bf8d4bb1ca3e53064521e5cf2.tar.gz
rpg-0b173dce41bf258bf8d4bb1ca3e53064521e5cf2.tar.bz2
media manager validity fixes
darcs-hash:20060525172718-7ad00-4395765bab12098f5fb8c4ec6d1f98ffd8937f0c.gz
-rw-r--r--inc/media.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/inc/media.php b/inc/media.php
index cefd90f3f..d4ee21956 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -340,7 +340,7 @@ function media_printfile($item,$auth,$jump){
echo '<span class="info">('.$info.')</span>'.NL;
media_fileactions($item,$auth);
echo '<div class="example" id="ex_'.$item['id'].'">';
- echo $lang['mediausage'].' <code>{{:'.$item['id'].'}}<code>';
+ echo $lang['mediausage'].' <code>{{:'.$item['id'].'}}</code>';
echo '</div>';
if($item['isimg']) media_printimgdetail($item);
echo '<div class="clearer"></div>'.NL;
@@ -375,20 +375,22 @@ function media_printimgdetail($item){
echo '</a>';
echo '</div>';
- //read EXIF/IPTC data
- echo '<p>';
+ // read EXIF/IPTC data
$t = $item['meta']->getField('IPTC.Headline');
- if($t) echo '<strong>'.htmlspecialchars($t).'</strong><br />';
-
- $t = $item['meta']->getField(array('IPTC.Caption','EXIF.UserComment',
+ $d = $item['meta']->getField(array('IPTC.Caption','EXIF.UserComment',
'EXIF.TIFFImageDescription',
'EXIF.TIFFUserComment'));
- if(utf8_strlen($t) > 250) $t = utf8_substr($t,0,250).'...';
- if($t) echo htmlspecialchars($t).'<br />';
-
- $t = $item['meta']->getField(array('IPTC.Keywords','IPTC.Category'));
- if($t) echo '<em>'.htmlspecialchars($t).'</em>';
- echo '</p>';
+ if(utf8_strlen($d) > 250) $d = utf8_substr($d,0,250).'...';
+ $k = $item['meta']->getField(array('IPTC.Keywords','IPTC.Category'));
+
+ // print EXIF/IPTC data
+ if($t || $d || $k ){
+ echo '<p>';
+ if($t) echo '<strong>'.htmlspecialchars($t).'</strong><br />';
+ if($d) echo htmlspecialchars($d).'<br />';
+ if($t) echo '<em>'.htmlspecialchars($k).'</em>';
+ echo '</p>';
+ }
echo '</div>';
}