diff options
author | Kate Arzamastseva <pshns@ukr.net> | 2011-06-29 16:59:18 +0300 |
---|---|---|
committer | Kate Arzamastseva <pshns@ukr.net> | 2011-06-29 16:59:18 +0300 |
commit | 3e98e6857f2c48127d4169d02e341d1013c00bac (patch) | |
tree | aeb8ee75d550d15dea7283fa51aaf1f225767fb4 /inc | |
parent | e18ba5797b635bf97755910093c3eed1f9667362 (diff) | |
download | rpg-3e98e6857f2c48127d4169d02e341d1013c00bac.tar.gz rpg-3e98e6857f2c48127d4169d02e341d1013c00bac.tar.bz2 |
media getting metadata fix
Diffstat (limited to 'inc')
-rw-r--r-- | inc/media.php | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/inc/media.php b/inc/media.php index b2d608860..d90a13c81 100644 --- a/inc/media.php +++ b/inc/media.php @@ -99,14 +99,9 @@ function media_metaform($id,$auth,$fullscreen = false){ // load the field descriptions static $fields = null; if(is_null($fields)){ - - foreach (array('default','local') as $config_group) { - if (empty($config_cascade['mediameta'][$config_group])) continue; - foreach ($config_cascade['mediameta'][$config_group] as $config_file) { - if(@file_exists($config_file)){ - include($config_file); - } - } + $config_files = getConfigFiles('mediameta'); + foreach ($config_files as $config_file) { + if(@file_exists($config_file)) include($config_file); } } @@ -123,6 +118,7 @@ function media_metaform($id,$auth,$fullscreen = false){ formSecurityToken(); foreach($fields as $key => $field){ // get current value + if (empty($field[0])) continue; $tags = array($field[0]); if(is_array($field[3])) $tags = array_merge($tags,$field[3]); $value = tpl_img_getTag($tags,'',$src); @@ -837,29 +833,26 @@ function media_details($image, $auth, $rev=false) { } // load the field descriptions - static $tags = null; - if(is_null($tags)){ - foreach (array('default','local') as $config_group) { - if (empty($config_cascade['mediameta'][$config_group])) continue; - foreach ($config_cascade['mediameta'][$config_group] as $config_file) { - if(@file_exists($config_file)){ - include($config_file); - } - } + static $fields = null; + if(is_null($fields)){ + $config_files = getConfigFiles('mediameta'); + foreach ($config_files as $config_file) { + if(@file_exists($config_file)) include($config_file); } } $src = mediaFN($image, $rev); $meta = new JpegMeta($src); echo '<dl class="img_tags">'; - foreach($tags as $key => $tag){ - $t = $tag[0]; - if (!is_array($t)) $t = array($tag[0]); + foreach($fields as $key => $tag){ + $t = array(); + if (!empty($tag[0])) $t = array($tag[0]); + if(is_array($tag[3])) $t = array_merge($t,$tag[3]); $value = media_getTag($t, $meta, '-'); $value = cleanText($value); echo '<dt>'.$lang[$tag[1]].':</dt><dd>'; - if ($tag[2] == 'text') echo hsc($value); if ($tag[2] == 'date') echo dformat($value); + else echo hsc($value); echo '</dd>'; } echo '</dl>'; |