Ignore:
Timestamp:
May 18, 2010, 10:15:25 PM (14 years ago)
Author:
EXFTB
Message:

2.1.a compliant hdshadowbox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/LLGBO2/main.inc.php

    r4869 r6234  
    22/*
    33Plugin Name: Look_like_gbo2
    4 Version:  2.0.O
     4Version:  2.1.a
    55Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=251
    66Author: Ex-Ftb 
     
    88Description:  Display thumbnail under button. Add navigation on picture look like GBo Gallery
    99Add 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
    2412if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    2513/* création d'une instance de la classe   */
     
    2715global $conf;
    2816
    29 define ('LLGBO_INFO_VERSION','2.0.O');
     17define ('LLGBO_INFO_VERSION','2.1.a');
    3018if (!defined('LLGBO_PATH'))
    3119{define('LLGBO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');}
     
    3523 $conf['LLGBO_FRAME'] = explode (",",$conf['LLGBOFRAME']);
    3624 $conf['LLGBO_HEADER'] = explode (",",$conf['LLGBOHEADER']);   
    37  
    3825/////////////////////////////////////////////////////
    3926/*  PLUGIN CLASS  */
     
    5845        If ($conf['LLGBO_SETTINGS'][10]  == 'true' )  //always display metadata
    5946        {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                 }}
    6149}
    6250//-------------------------------------------------------------
     
    11098{$template->append('head_elements',"\n".' <STYLE type="text/css">#theHeader{display: none}</STYLE>');}
    11199}       
    112 //
    113 If ($conf['LLGBO_SETTINGS'] [9]  == 'true' )
    114 {$template->append('head_elements',"\n".' <STYLE type="text/css">.navThumb{display: none} </STYLE>');}
    115100 
     101
     102 
    116103}  // end header
    117104 
     
    120107//-------------------------------------------------------------
    121108function  DisplayGboLook()
    122 { global $template,$conf;
     109{ global $template,$conf,$lang;
     110    $meta = "";
    123111        $u_metadata = $template->get_template_vars('U_METADATA');
    124112        $swt =   ' swttips="'; 
     
    128116                {foreach($metadata[0] as $cle =>$tableau)
    129117                         { 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;}
    132121                        }       }
     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                       
    133126                        $template->assign( 'U_METADATA', $u_metadata.'"'.$swt);
    134                 $template->Clear_assign('metadata');
     127                        $template->Clear_assign('metadata');
     128                       
    135129        } // hide original metadata
    136130                }
     
    186180        }       
    187181///// 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'];
    190185/////////////////////////////////////////////
    191186// AN OTHER PLUGIN IS WORKING -> GO BACK
     
    196191/////////////////////////////////////////////////////////////////       
    197192if ($ThePicture['is_picture'] <> 1 )    {  return $content;  ; }       
    198 //
    199 if ( strtoupper($tpl_name) == 'GALLY') {
     193//echo  $tpl_id;
     194
     195$template->assign('GALLY','');
     196if (( strpos(strtoupper($tpl_id) , 'GALLY') === true) )
     197 {      $template->assign('GALLY','ok');
    200198                                        return $content;  ; }   // Not compliant with Gally
    201199/////////////////////////////////////////////////////////////////       
     
    203201                        {$linkcss = '<link rel="stylesheet" type="text/css" href="'.LLGBO_PATH;
    204202                        $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                          }
    209205//----------------------------------------------------   
    210206//-------      Usemap   values         -------------     
     
    236232//----------------------------------------------------   
    237233$alt = $conf['allow_html_descriptions'] ? $ThePicture['name'] : strip_tags($ThePicture['name']);
    238 /*
     234
     235/* */
    239236$related_cats =   $template->get_template_vars('related_categories');
    240237if (isset($related_cats))
     
    243240        $related_cat = str_replace($conf['level_separator'],"-",$related_cat);
    244241        }
    245 $alt= $related_cat.' '.$alt; 
    246 */
     242 $alt = $alt.' - ['.$related_cat.']';
    247243//-----------------------------------------------------------------
    248244$template->assign( array(
     
    259255                 'high', array(
    260256                                '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}
    262270
    263271If (($conf['LLGBO_SETTINGS'] [5]  == 'true' )  /* title on frame */ and ($conf['LLGBO_SETTINGS'] [0]  == 'true' )) // display frame
     
    266274               
    267275// compatibility with extended description
    268 $ThePicture = $template->get_template_vars('current');
    269276$comment = $template->get_template_vars('COMMENT_IMG');
    270277if (!isset($comment) )
     
    297304{$template->clear_assign('FRAME_BEGIN') ;}
    298305
    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') );
     307return $template->parse( 'default_content', true);
    301308} //end --> MyPictureOptions
    302309} // End class
Note: See TracChangeset for help on using the changeset viewer.