Changeset 1989 for plugins/efiMetadatas
- Timestamp:
- 12/18/09 01:47:08 (14 years ago)
- Location:
- plugins/efiMetadatas
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/efiMetadatas/_define.php
r1918 r1989 17 17 /* Description*/ "Show metadatas of first image of an entry", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0. 1',19 /* Version */ '0.2', 20 20 /* Permissions */ 'admin' 21 21 ); 22 /* date */ #20091 12922 /* date */ #20091218 23 23 ?> -
plugins/efiMetadatas/_widgets.php
r1918 r1989 68 68 if ($w->category != 'null' && $w->category != '' && $w->category != $_ctx->posts->cat_id) return; 69 69 70 # Path and url 71 $p_url = $core->blog->settings->public_url; 72 $p_site = preg_replace('#^(.+?//.+?)/(.*)$#','$1',$core->blog->url); 73 $p_root = $core->blog->public_path; 70 # Content lookup 71 $text = $_ctx->posts->post_excerpt_xhtml.$_ctx->posts->post_content_xhtml; 74 72 75 # Image pattern 76 $pattern = '(?:'.preg_quote($p_site,'/').')?'.preg_quote($p_url,'/'); 77 $pattern = sprintf('/<img.+?src="%s(.*?\.(?:jpg|gif|png))"[^>]+/msu',$pattern); 78 79 # Content lookup 80 $subject = $_ctx->posts->post_excerpt_xhtml.$_ctx->posts->post_content_xhtml; 73 # Find source image 74 $img = efiMetadatas::imgSource($core,$text,$w->thumbsize); 81 75 82 76 # No image 83 if (!preg_match_all($pattern,$subject,$m)) return; 84 85 $src = false; 86 $size = $w->thumbsize; 87 $alt = $metas = $thumb = ''; 88 $allowed_ext = array('.jpg','.JPG','.png','.PNG','.gif','.GIF'); 89 90 # Loop through images 91 foreach ($m[1] as $i => $img) 92 { 93 $src = false; 94 $info = path::info($img); 95 $base = $info['base']; 96 $ext = $info['extension']; 97 98 # Not original 99 if (preg_match('/^\.(.+)_(sq|t|s|m)$/',$base,$mbase)) 100 { 101 $base = $mbase[1]; 102 } 103 104 # Full path 105 $f = $p_root.'/'.$info['dirname'].'/'.$base; 106 107 # Find extension 108 foreach($allowed_ext as $end) 109 { 110 if (file_exists($f.$end)) 111 { 112 $src = $f.$end; 113 break; 114 } 115 } 116 117 # No file 118 if (!$src) continue; 119 120 # Find thumbnail 121 if (!empty($size)) 122 { 123 $t = $p_root.'/'.$info['dirname'].'/.'.$base.'_'.$size.'.jpg'; 124 if (file_exists($t)) 125 { 126 $thb = $p_url.(dirname($img) != '/' ? dirname($img) : '').'/.'.$base.'_'.$size.'.jpg'; 127 } 128 } 129 130 # Find image description 131 if (preg_match('/alt="([^"]+)"/',$m[0][$i],$malt)) 132 { 133 $alt = $malt[1]; 134 } 135 break; 136 } 137 138 # No image 139 if (!$src || !file_exists($src)) return; 140 141 # Image info 142 $metas_array = imageMeta::readMeta($src); 77 if (!$img['source']) return; 143 78 144 79 # List metas 145 foreach($metas_array as $k => $v) 80 $metas = efiMetadatas::imgMeta($core,$img['source']); 81 82 $content = ''; 83 foreach($metas as $k => $v) 146 84 { 147 if (!$w->showmeta && !$v) continue; 148 $metas .= '<li><strong>'.__($k.':').'</strong><br />'.$v.'</li>'; 85 // keep empty meta if wanted 86 if (!$w->showmeta && empty($v[1])) continue; 87 $content .= '<li class="efi-'.$k.'"><strong>'.$v[0].':</strong><br />'.$v[1].'</li>'; 149 88 } 150 89 151 90 # No meta 152 if (empty($metas)) return; 153 91 if (empty($content)) return; 154 92 155 93 # thumbnail 156 if ( !empty($thb))94 if ($img['thumb']) 157 95 { 158 96 $thumb = 159 97 '<div class="img-box">'. 160 98 '<div class="img-thumbnail">'. 161 '<img alt="'.$ alt.'" src="'.$thb.'" />'.99 '<img alt="'.$img['title'].'" src="'.$img['thumb'].'" />'. 162 100 '</div>'. 163 101 "</div>\n"; … … 168 106 ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''). 169 107 $thumb. 170 '<ul>'.$ metas.'</ul>'.108 '<ul>'.$content.'</ul>'. 171 109 '</div>'; 172 110 } -
plugins/efiMetadatas/locales/fr/main.lang.php
r1918 r1989 2 2 // Language: français 3 3 // Module: efiMetadatas - 0.1 4 // Date: 2009-1 1-29 15:34:434 // Date: 2009-12-18 00:28:47 5 5 // Translated with dcTranslater - 1.3 6 6 … … 29 29 $GLOBALS['__l10n']['Show empty metadatas'] = 'Afficher les métadonnées vides'; 30 30 31 #inc/class.efimetadatas.php:79 32 $GLOBALS['__l10n']['Location'] = 'Lieu'; 33 34 #inc/class.efimetadatas.php:81 35 $GLOBALS['__l10n']['Manufacturer'] = 'Fabricant'; 36 37 #inc/class.efimetadatas.php:82 38 $GLOBALS['__l10n']['Model'] = 'Model'; 39 40 #inc/class.efimetadatas.php:83 41 $GLOBALS['__l10n']['Lens'] = 'Obgectif'; 42 43 #inc/class.efimetadatas.php:84 44 $GLOBALS['__l10n']['Program'] = 'Programme'; 45 46 #inc/class.efimetadatas.php:85 47 $GLOBALS['__l10n']['Speed'] = 'Vitesse'; 48 49 #inc/class.efimetadatas.php:86 50 $GLOBALS['__l10n']['Aperture'] = 'Ouverture'; 51 52 #inc/class.efimetadatas.php:87 53 $GLOBALS['__l10n']['ISO'] = 'ISO'; 54 55 #inc/class.efimetadatas.php:88 56 $GLOBALS['__l10n']['Focal'] = 'Focale'; 57 58 #inc/class.efimetadatas.php:89 59 $GLOBALS['__l10n']['Exposure Bias'] = 'Décalage d\'exposition'; 60 61 #inc/class.efimetadatas.php:90 62 $GLOBALS['__l10n']['Metering mode'] = 'Mode de mesure'; 63 64 #inc/class.efimetadatas.php:94 65 $GLOBALS['__l10n']['Not defined'] = 'Non défini'; 66 67 #inc/class.efimetadatas.php:95 68 $GLOBALS['__l10n']['Manual'] = 'Manuel'; 69 70 #inc/class.efimetadatas.php:96 71 $GLOBALS['__l10n']['Normal program'] = 'Normal'; 72 73 #inc/class.efimetadatas.php:97 74 $GLOBALS['__l10n']['Aperture priority'] = 'Priorité à l\'ouverture'; 75 76 #inc/class.efimetadatas.php:98 77 $GLOBALS['__l10n']['Shutter priority'] = 'Priorité à la vitesse'; 78 79 #inc/class.efimetadatas.php:99 80 $GLOBALS['__l10n']['Creative program'] = 'Création'; 81 82 #inc/class.efimetadatas.php:100 83 $GLOBALS['__l10n']['Action program'] = 'Action'; 84 85 #inc/class.efimetadatas.php:101 86 $GLOBALS['__l10n']['Portait mode'] = 'Portrait'; 87 88 #inc/class.efimetadatas.php:102 89 $GLOBALS['__l10n']['Landscape mode'] = 'Paysage'; 90 91 #inc/class.efimetadatas.php:106 92 $GLOBALS['__l10n']['Unknow'] = 'Inconnu'; 93 94 #inc/class.efimetadatas.php:107 95 $GLOBALS['__l10n']['Average'] = 'Moyenne'; 96 97 #inc/class.efimetadatas.php:108 98 $GLOBALS['__l10n']['Center-weighted average'] = 'Centrale pondèrée'; 99 100 #inc/class.efimetadatas.php:109 101 $GLOBALS['__l10n']['Spot'] = 'Spot'; 102 103 #inc/class.efimetadatas.php:110 104 $GLOBALS['__l10n']['Multi spot'] = 'Multi spot'; 105 106 #inc/class.efimetadatas.php:111 107 $GLOBALS['__l10n']['Pattern'] = 'Multizone'; 108 109 #inc/class.efimetadatas.php:112 110 $GLOBALS['__l10n']['Partial'] = 'Partielle'; 111 112 #inc/class.efimetadatas.php:113 113 $GLOBALS['__l10n']['Other'] = 'Autre'; 114 31 115 ?> -
plugins/efiMetadatas/locales/fr/main.po
r1918 r1989 1 1 # Language: français 2 2 # Module: efiMetadatas - 0.1 3 # Date: 2009-1 1-29 15:34:433 # Date: 2009-12-18 00:28:47 4 4 # Translated with translater 1.3 5 5 … … 9 9 "Project-Id-Version: efiMetadatas 0.1\n" 10 10 "POT-Creation-Date: \n" 11 "PO-Revision-Date: 2009-1 1-29T15:34:43+00:00\n"11 "PO-Revision-Date: 2009-12-18T00:28:47+00:00\n" 12 12 "Last-Translator: JC Denis\n" 13 13 "Language-Team: \n" … … 47 47 msgstr "Afficher les métadonnées vides" 48 48 49 #: inc/class.efimetadatas.php:79 50 msgid "Location" 51 msgstr "Lieu" 52 53 #: inc/class.efimetadatas.php:81 54 msgid "Manufacturer" 55 msgstr "Fabricant" 56 57 #: inc/class.efimetadatas.php:82 58 msgid "Model" 59 msgstr "Model" 60 61 #: inc/class.efimetadatas.php:83 62 msgid "Lens" 63 msgstr "Obgectif" 64 65 #: inc/class.efimetadatas.php:84 66 msgid "Program" 67 msgstr "Programme" 68 69 #: inc/class.efimetadatas.php:85 70 msgid "Speed" 71 msgstr "Vitesse" 72 73 #: inc/class.efimetadatas.php:86 74 msgid "Aperture" 75 msgstr "Ouverture" 76 77 #: inc/class.efimetadatas.php:87 78 msgid "ISO" 79 msgstr "ISO" 80 81 #: inc/class.efimetadatas.php:88 82 msgid "Focal" 83 msgstr "Focale" 84 85 #: inc/class.efimetadatas.php:89 86 msgid "Exposure Bias" 87 msgstr "Décalage d'exposition" 88 89 #: inc/class.efimetadatas.php:90 90 msgid "Metering mode" 91 msgstr "Mode de mesure" 92 93 #: inc/class.efimetadatas.php:94 94 msgid "Not defined" 95 msgstr "Non défini" 96 97 #: inc/class.efimetadatas.php:95 98 msgid "Manual" 99 msgstr "Manuel" 100 101 #: inc/class.efimetadatas.php:96 102 msgid "Normal program" 103 msgstr "Normal" 104 105 #: inc/class.efimetadatas.php:97 106 msgid "Aperture priority" 107 msgstr "Priorité à l'ouverture" 108 109 #: inc/class.efimetadatas.php:98 110 msgid "Shutter priority" 111 msgstr "Priorité à la vitesse" 112 113 #: inc/class.efimetadatas.php:99 114 msgid "Creative program" 115 msgstr "Création" 116 117 #: inc/class.efimetadatas.php:100 118 msgid "Action program" 119 msgstr "Action" 120 121 #: inc/class.efimetadatas.php:101 122 msgid "Portait mode" 123 msgstr "Portrait" 124 125 #: inc/class.efimetadatas.php:102 126 msgid "Landscape mode" 127 msgstr "Paysage" 128 129 #: inc/class.efimetadatas.php:106 130 msgid "Unknow" 131 msgstr "Inconnu" 132 133 #: inc/class.efimetadatas.php:107 134 msgid "Average" 135 msgstr "Moyenne" 136 137 #: inc/class.efimetadatas.php:108 138 msgid "Center-weighted average" 139 msgstr "Centrale pondèrée" 140 141 #: inc/class.efimetadatas.php:109 142 msgid "Spot" 143 msgstr "Spot" 144 145 #: inc/class.efimetadatas.php:110 146 msgid "Multi spot" 147 msgstr "Multi spot" 148 149 #: inc/class.efimetadatas.php:111 150 msgid "Pattern" 151 msgstr "Multizone" 152 153 #: inc/class.efimetadatas.php:112 154 msgid "Partial" 155 msgstr "Partielle" 156 157 #: inc/class.efimetadatas.php:113 158 msgid "Other" 159 msgstr "Autre" 160
Note: See TracChangeset
for help on using the changeset viewer.