Changeset 6234 for extensions/LLGBO2/main.inc.php
- Timestamp:
- May 18, 2010, 10:15:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LLGBO2/main.inc.php
r4869 r6234 2 2 /* 3 3 Plugin Name: Look_like_gbo2 4 Version: 2. 0.O4 Version: 2.1.a 5 5 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=251 6 6 Author: Ex-Ftb … … 8 8 Description: Display thumbnail under button. Add navigation on picture look like GBo Gallery 9 9 Add a border around picture ...... 10 */ 11 /* 2.0.d fix notice when HD picture is desactivate*/ 12 /* 2.0.e fix notice with redirec.tpl */ 13 /* 2.0.f Tooltip and frame define by plugin vs Css*/ 14 /* 2.0.g always display metadata + maintain IPTC */ 15 /* 2.0.h new languages PL, ES, HU */ 16 /* 2.0.i Manage tab for tooltip and frame settings */ 17 /* 2.0.J add sample display and fix bug in admin with chrome */ 18 /* 2.0.K fix warning du to language file */ 19 /* 2.0.L Avoid problem with Gally */ 20 /* 2.0.M - fix bug on image alt attribute 21 - fix bug on active -> erase the paramater when it's not mandatory. */ 22 /* 2.0.N - fix bug no navigation on picture, whit out frame */ 23 /* 2.0.O - compliant with extended description */ 10 2.1.a compliant 2.1 Piwigo */ 11 24 12 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 25 13 /* création d'une instance de la classe */ … … 27 15 global $conf; 28 16 29 define ('LLGBO_INFO_VERSION','2. 0.O');17 define ('LLGBO_INFO_VERSION','2.1.a'); 30 18 if (!defined('LLGBO_PATH')) 31 19 {define('LLGBO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');} … … 35 23 $conf['LLGBO_FRAME'] = explode (",",$conf['LLGBOFRAME']); 36 24 $conf['LLGBO_HEADER'] = explode (",",$conf['LLGBOHEADER']); 37 38 25 ///////////////////////////////////////////////////// 39 26 /* PLUGIN CLASS */ … … 58 45 If ($conf['LLGBO_SETTINGS'][10] == 'true' ) //always display metadata 59 46 {if ( pwg_get_session_var('show_metadata') == null ) 60 { pwg_set_session_var('show_metadata', 1 );}} 47 { pwg_set_session_var('show_metadata', 1 ); 48 }} 61 49 } 62 50 //------------------------------------------------------------- … … 110 98 {$template->append('head_elements',"\n".' <STYLE type="text/css">#theHeader{display: none}</STYLE>');} 111 99 } 112 //113 If ($conf['LLGBO_SETTINGS'] [9] == 'true' )114 {$template->append('head_elements',"\n".' <STYLE type="text/css">.navThumb{display: none} </STYLE>');}115 100 101 102 116 103 } // end header 117 104 … … 120 107 //------------------------------------------------------------- 121 108 function DisplayGboLook() 122 { global $template,$conf; 109 { global $template,$conf,$lang; 110 $meta = ""; 123 111 $u_metadata = $template->get_template_vars('U_METADATA'); 124 112 $swt = ' swttips="'; … … 128 116 {foreach($metadata[0] as $cle =>$tableau) 129 117 { if(is_array($tableau)) 130 {foreach($tableau as $cle=>$valeur) 131 { $swt= $swt.$cle.' : '.$valeur.'<br>'; } 118 { foreach($tableau as $cle=>$valeur) 119 { $swt= $swt.$cle.' : '.$valeur.'<br>'; 120 $meta = 1;} 132 121 } } 122 if ( pwg_get_session_var('show_metadata') == 1 ) 123 { $lang['picture_show_metadata'] = 'EXIF Metadata'; 124 if ($meta != 1 ) {$lang['picture_show_metadata'] = 'No Metadata';}} 125 133 126 $template->assign( 'U_METADATA', $u_metadata.'"'.$swt); 134 $template->Clear_assign('metadata'); 127 $template->Clear_assign('metadata'); 128 135 129 } // hide original metadata 136 130 } … … 186 180 } 187 181 ///// YOGA or SIMPLE ///////////////////// 188 $themeconf = $template->get_template_vars('themeconf'); 189 $tpl_name = $themeconf['template']; 182 $tpl_name = ""; 183 $currenttheme = $template->get_template_vars('themes'); 184 $tpl_id = $currenttheme[0]['id']; 190 185 ///////////////////////////////////////////// 191 186 // AN OTHER PLUGIN IS WORKING -> GO BACK … … 196 191 ///////////////////////////////////////////////////////////////// 197 192 if ($ThePicture['is_picture'] <> 1 ) { return $content; ; } 198 // 199 if ( strtoupper($tpl_name) == 'GALLY') { 193 //echo $tpl_id; 194 195 $template->assign('GALLY',''); 196 if (( strpos(strtoupper($tpl_id) , 'GALLY') === true) ) 197 { $template->assign('GALLY','ok'); 200 198 return $content; ; } // Not compliant with Gally 201 199 ///////////////////////////////////////////////////////////////// … … 203 201 {$linkcss = '<link rel="stylesheet" type="text/css" href="'.LLGBO_PATH; 204 202 $template->append('head_elements',$linkcss.'css/gbolook.css">'); 205 if ( strtoupper($tpl_name) == 'SIMPLE') { 206 $template->append('head_elements',"\n".' <STYLE type="text/css">#theImage{margin:auto;overflow: hidden;} </STYLE>');} 207 } 208 203 $template->append('head_elements',"\n".' <STYLE type="text/css">#theImage{margin:auto;overflow: hidden;}</STYLE>'); 204 } 209 205 //---------------------------------------------------- 210 206 //------- Usemap values ------------- … … 236 232 //---------------------------------------------------- 237 233 $alt = $conf['allow_html_descriptions'] ? $ThePicture['name'] : strip_tags($ThePicture['name']); 238 /* 234 235 /* */ 239 236 $related_cats = $template->get_template_vars('related_categories'); 240 237 if (isset($related_cats)) … … 243 240 $related_cat = str_replace($conf['level_separator'],"-",$related_cat); 244 241 } 245 $alt= $related_cat.' '.$alt; 246 */ 242 $alt = $alt.' - ['.$related_cat.']'; 247 243 //----------------------------------------------------------------- 248 244 $template->assign( array( … … 259 255 'high', array( 260 256 'U_HIGH' => $ThePicture['high_url'] , 261 'UUID' => $uuid, ));} 257 'UUID' => $uuid, )); 258 // compliance HD LIGHTBOX 259 If ($conf['LLGBO_SETTINGS'] [9] == 'true' ) 260 {$template->assign('HDHREF', ' href="'.$ThePicture['high_url'].'"'.' title= " HD --> '.$ThePicture['name'].'"'); 261 $template->append('head_elements', "/n".'<script type="text/javascript"> 262 window.onload = function() { 263 Shadowbox.setup(document.getElementById("prevnext").getElementsByTagName("area")[3]); 264 } 265 </script>' );} 266 else 267 {$template->assign('HDHREF','href="javascript:phpWGOpenWindow('."'".$ThePicture['high_url']."','".$uuid."','"."scrollbars=yes,toolbar=no,status=no,resizable=yes'".')"');} 268 269 } 262 270 263 271 If (($conf['LLGBO_SETTINGS'] [5] == 'true' ) /* title on frame */ and ($conf['LLGBO_SETTINGS'] [0] == 'true' )) // display frame … … 266 274 267 275 // compatibility with extended description 268 $ThePicture = $template->get_template_vars('current');269 276 $comment = $template->get_template_vars('COMMENT_IMG'); 270 277 if (!isset($comment) ) … … 297 304 {$template->clear_assign('FRAME_BEGIN') ;} 298 305 299 $template->set_filenames( array(' gbo_content'=> dirname(__FILE__).'/template/picture_content.tpl') );300 return $template->parse( ' gbo_content', true);306 $template->set_filenames( array('default_content'=> dirname(__FILE__).'/template/picture_content.tpl') ); 307 return $template->parse( 'default_content', true); 301 308 } //end --> MyPictureOptions 302 309 } // End class
Note: See TracChangeset
for help on using the changeset viewer.