Changeset 14421


Ignore:
Timestamp:
Apr 25, 2012, 9:11:00 PM (12 years ago)
Author:
gbo
Message:

LLGBO2 Beta for piwigo 2.4RC2

Location:
extensions/LLGBO2
Files:
7 added
4 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/LLGBO2/admin/llgbo_admin.php

    r10453 r14421  
    122122        if (!isset($_POST['llgbo_tooltip_disp'])) {$_POST['llgbo_tooltip_disp'] = 'false';} 
    123123        if (!isset($_POST['llgbo_exifunderbt'])) {$_POST['llgbo_exifunderbt'] = 'false';} 
    124         if (!isset($_POST['llgbo_usemap'])) {$_POST['llgbo_usemap'] = 'false';}
     124        if (!isset($_POST['llgbo_jquery'])) {$_POST['llgbo_jquery'] = 'false';}
     125
    125126        if (!isset($_POST['llgbo_usemap_thumb'])) {$_POST['llgbo_usemap_thumb'] = 'false';}
    126127        if (!isset($_POST['llgbo_title_frame'])) {$_POST['llgbo_title_frame'] = 'false';}   
     
    128129        if (!isset($_POST['llgbo_maintain_header'])) {$_POST['llgbo_maintain_header'] = '';}
    129130        if (!isset($_POST['llgbo_allinfo'])) {$_POST['llgbo_allinfo'] = 'false';}
    130     if (!isset($_POST['llgbo_hdShadowbox'])) {$_POST['llgbo_hdShadowbox'] = 'false';}
    131         // compliance HD Shadowbox
    132           $shadowbowactive = 0;
    133           $query =" SELECT ID FROM  ".$prefixeTable."plugins where id ="."'HDShadowbox'"." and state ='active'" ;
    134       $result = pwg_query($query);
    135           while ($row = pwg_db_fetch_assoc($result))
    136                 { $shadowbowactive = 1;} 
    137         if ($shadowbowactive == 0)
    138                 { if ($_POST['llgbo_hdShadowbox'] != 'false')
    139                 {$lang['llgbo_hdShadowbox'] =  ' * * * * '.$lang['llgbo_hdShadowbox'].' * * * * '; }
    140                 $_POST['llgbo_hdShadowbox'] = 'false';
    141                 }
     131    if (!isset($_POST['llgbo_free'])) {$_POST['llgbo_free'] = 'false';}
    142132       
    143133        if (!isset($_POST['llgbo_always_displayexif'])) {$_POST['llgbo_always_displayexif'] = 'false';} //10   
    144134         $param_llgbo = array($_POST['llgbo_frame'],
    145135                                $_POST['llgbo_tooltip_disp'],             $_POST['llgbo_exifunderbt'],
    146                                 $_POST['llgbo_usemap'],                 $_POST['llgbo_usemap_thumb'],
     136                                $_POST['llgbo_jquery'],                 $_POST['llgbo_usemap_thumb'],
    147137                                $_POST['llgbo_title_frame'],                    $_POST['llgbo_header'],
    148138                                $_POST['llgbo_maintain_header'],                        $_POST['llgbo_allinfo'],
    149                                 $_POST['llgbo_hdShadowbox']     ,$_POST['llgbo_always_displayexif']
     139                                $_POST['llgbo_free']    ,$_POST['llgbo_always_displayexif']
    150140                        );               
    151141        $llgbo_new_value = implode ("," , $param_llgbo);
     
    170160          {$template->assign('LLGBO_EXIFUNDERBT' , 'true');}  else  {$template->assign( 'LLGBO_EXIFUNDERBT' , "false");}
    171161        if ($conf['LLGBO_SETTINGS'][3]  == 'true')
    172           {$template->assign( array( 'LLGBO_USEMAP' => 'true'));}  else  { $template->assign( array( 'LLGBO_USEMAP' => "false"));}
     162          {$template->assign( array( 'LLGBO_JQUERY' => 'true'));}  else  { $template->assign( array( 'LLGBO_JQUERY' => "false"));}
    173163        if ($conf['LLGBO_SETTINGS'][4]  == 'true')
    174164          {$template->assign( array( 'LLGBO_USEMAP_THUMB' => 'true'));}  else  { $template->assign( array( 'LLGBO_USEMAP_THUMB' => "false"));}
     
    181171          {$template->assign(array( 'LLGBO_ALLINFO' => 'true'));}  else {  $template->assign( array( 'LLGBO_ALLINFO' => "false"));}
    182172        if ($conf['LLGBO_SETTINGS'][9] == 'true')
    183           {$template->assign(array( 'LLGBO_HDShadowbox' => 'true'));}  else  { $template->assign(array( 'LLGBO_HDShadowbox' => "false"));}
     173          {$template->assign(array( 'LLGBO_FREE' => 'true'));}  else  { $template->assign(array( 'LLGBO_FREE' => "false"));}
    184174        if ($conf['LLGBO_SETTINGS'][10] == 'true')
    185175          {$template->assign(array( 'LLGBO_ALWAYS_DISPLAYEXIF' => 'true'));}  else  { $template->assign(array( 'LLGBO_ALWAYS_DISPLAYEXIF' => "false"));}
  • extensions/LLGBO2/admin/llgbo_adminsettings.tpl

    r6259 r14421  
    2525                <td class="llgboinput"> {html_radios name='llgbo_exifunderbt' values='true,false'|@explode output='Yes,No'|@explode|translate selected=$LLGBO_EXIFUNDERBT}</td>
    2626  </tr>
    27   <tr>
     27<!--   Now in the Piwigo core
     28 <tr>
    2829                <td class="llgbolabel">{'llgbo_usemap'|@translate}</td>
    2930                <td class="llgboinput">{html_radios name='llgbo_usemap' values='true,false'|@explode output='Yes,No'|@explode|translate selected=$LLGBO_USEMAP}</td>
    3031        </tr>
     32
    3133        <tr>
    3234                <td class="llgbolabel">{'llgbo_usemap_thumb'|@translate}</td>
    3335                <td class="llgboinput">  {html_radios name='llgbo_usemap_thumb' values='true,false'|@explode output='Yes,No'|@explode|translate selected=$LLGBO_USEMAP_THUMB}</td>     
    3436        </tr>
     37                -->
    3538        <tr>
    3639                <td class="llgbolabel">{'llgbo_title_frame'|@translate}</td>
     
    4245                <td class="llgboinput">{html_radios name='llgbo_header' values='true,false'|@explode output='Yes,No'|@explode|translate selected=$LLGBO_HEADER}</td>   
    4346        </tr>   
    44         <tr><td class="llgbolabel"><HR WIDTH=80% ALIGN=LEFT></td> <td></td>
     47  <!--   free was removed
     48        <tr><td class="llgbolabel"><HR WIDTH=90% ALIGN=LEFT></td> <td></td>
     49        <tr>
     50                <td class="llgbolabel">{'llgbo_jquery'|@translate}</td>
     51                <td class="llgboinput">{html_radios name='llgbo_jquery' values='true,false'|@explode output='Yes,No'|@explode|translate selected=$LLGBO_JQUERY}</td>
     52        </tr>
     53
     54        <tr><td class="llgbolabel"><HR WIDTH=90% ALIGN=LEFT></td> <td></td>
    4555        </tr>
    4656        <tr>
    47                 <td class="llgbolabel">{'llgbo_hdShadowbox'|@translate}</td>
    48                 <td class="llgboinput">{html_radios name='llgbo_hdShadowbox' values='true,false'|@explode output='Yes,No'|@explode|translate selected=$LLGBO_HDShadowbox}</td>
    49         </tr>   
     57                <td class="llgbolabel">{'llgbo_free'|@translate}</td>
     58                <td class="llgboinput">{html_radios name='llgbo_free' values='true,false'|@explode output='Yes,No'|@explode|translate selected=$LLGBO_FREE}</td>
     59        </tr> 
     60-->
    5061</table>
    5162
  • extensions/LLGBO2/main.inc.php

    r12631 r14421  
    22/*
    33Plugin Name: Look_like_gbo2
    4 Version:  2.3.b
     4Version:  2.4.A
    55Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=251
    66Author: GBo
     
    88Description:  Display thumbnail under button. Add navigation on picture look like GBo Gallery
    99Add a border around  picture ......
    10   2.2.a compliant 2.2rc Piwigo
    11   2.2.b Full compliant 2.2 Piwigo + fix bug in admin
    12   2.2.c Fix JS bug with FF4.01 + add language Cz
    13   2.2.d fix bug with $high and openwindow
    14   2.3.a  new translation
    15   2.3.b  No modification on alt_img
     10        2.4.A Compliance Piwigo 2.4 + jquery
    1611 */
    1712if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    18 /* création d'une instance de la classe   */
    19 $obj = new look_like_gbo(); /* class loading */
     13
    2014global $conf;
    21 
    22 define ('LLGBO_INFO_VERSION','2.3.b');
     15define ('LLGBO_INFO_VERSION','2.4.A');
    2316if (!defined('LLGBO_PATH'))
    2417{define('LLGBO_PATH' ,get_root_url().'plugins/'.basename(dirname(__FILE__)) . '/');}
     
    2720 $conf['LLGBO_TOOLTIP'] = explode(",",$conf['LLGBOTOOLTIP']);
    2821 $conf['LLGBO_FRAME'] = explode (",",$conf['LLGBOFRAME']);
    29  $conf['LLGBO_HEADER'] = explode (",",$conf['LLGBOHEADER']);   
     22 $conf['LLGBO_HEADER'] = explode (",",$conf['LLGBOHEADER']);
     23       
    3024 load_language('plugin.lang', LLGBO_PATH);
    31 /////////////////////////////////////////////////////
    32 /*  PLUGIN CLASS  */
    33 /////////////////////////////////////////////////////
    34 class look_like_gbo
    35 {
    3625
    3726/* Set the administration panel of the plugin */
     
    4635/*       ALWAYS      DISPLAY      METADATA */
    4736//-------------------------------------------------------------
    48 function AutoDisplayMetadata()
    49 {global $conf;
    50          If ($conf['LLGBO_SETTINGS'] [2]  == 'true' )  // exif under bt
     37function llgbo_BeginPicture()
     38{global $conf,$template;
     39If ($conf['LLGBO_SETTINGS'] [2]  == 'true' )  // exif under bt
    5140        {$_GET['metadata'] = 'O';}
    5241       
    53         If ($conf['LLGBO_SETTINGS'][10]  == 'true' )  //always display metadata
     42If ($conf['LLGBO_SETTINGS'][10]  == 'true' )  //always display metadata
    5443        {if ( pwg_get_session_var('show_metadata') == null )
    5544                {  pwg_set_session_var('show_metadata', 1 );
    5645                 }}
     46
    5747}
    58 //-------------------------------------------------------------
    59 // RESET NOFOLLOW, NOINDEX
    60 //-------------------------------------------------------------
    61 function MyBeginheader()
     48
     49function llgbo_beginheader()
    6250{ global $page,$conf;
    63          If ($conf['LLGBO_SETTINGS'][2]  == 'true' ) // reset nofollow, noindex
     51        If ($conf['LLGBO_SETTINGS'][2]  == 'true' ) // reset nofollow, noindex
    6452        { unset ($page['meta_robots']);}
    6553}
     
    6755//      MANAGE               H E A D E R
    6856//-------------------------------------------------------------
    69 function Myheader()
     57function llgbo_endHeader()
    7058{global $template,$conf;
    7159$page_name = script_basename();
    72 if (!isset($page_name)) {$page_name ='index';}
    73 if ($conf['LLGBO_SETTINGS'] [6] = 'true' )
    74 {$no_header = false;
    75 
    76 $input= $_SERVER['PHP_SELF'];
    77 if ($conf['question_mark_in_urls'] == true)
    78  {      foreach($_GET as $cle  =>$valeur)
    79                 {$input= $input.$cle ;}
    80 }
    81 // print_r($input.'----'.$page_name );
    82 if  ( strpos( $input,'index') == true )
    83 {               
    84                 if ((strpos( $input,'index.php/') == false )  and ($conf['LLGBO_HEADER'][0] == 'false')) {$no_header = true;}// home
    85                 if ((strpos( $input,'categories') == true ) and ($conf['LLGBO_HEADER'][0] == 'false')) {$no_header = true;}// categories
    86                 if ((strpos( $input,'category') == true ) and ($conf['LLGBO_HEADER'][1] == 'false')) {$no_header = true; }
    87                 if ((strpos( $input,'filter=') == true ) and ($conf['LLGBO_HEADER'][2] == 'false')) {$no_header = true; }
    88                 if ((strpos( $input,'categories/flat') == true ) and ($conf['LLGBO_HEADER'][3] == 'false')) {$no_header = true ;}
    89                 if ((strpos( $input,'categories/posted-monthly-list') == true ) and ($conf['LLGBO_HEADER'][4] == 'false')) {$no_header = true ;}
    90                 if ((strpos( $input,'additional_page') == true ) and ($conf['LLGBO_HEADER'][6] == 'false')) {$no_header = true; }
    91                 if ((strpos( $input,'most_visited') == true ) and ($conf['LLGBO_HEADER'][7] == 'false')) {$no_header = true ;}
    92                 if ((strpos( $input,'best_rated') == true ) and ($conf['LLGBO_HEADER'][8] == 'false')) {$no_header = true; }
    93                 if ((strpos( $input,'list') == true ) and ($conf['LLGBO_HEADER'][9] == 'false')) {$no_header = true; }
    94                 if ((strpos( $input,'recent_pics') == true ) and ($conf['LLGBO_HEADER'][10] == 'false')) {$no_header = true ;}
    95                 if ((strpos( $input,'tags') == true ) and ($conf['LLGBO_HEADER'][11] == 'false')) {$no_header = true; }
    96                 if ((strpos( $input,'created-monthly-list') == true ) and ($conf['LLGBO_HEADER'][12] == 'false')) {$no_header = true;}
    97                 if ((strpos( $input,'favorites') == true ) and ($conf['LLGBO_HEADER'][19] == 'false')) {$no_header = true;}
    98                 if ((strpos( $input,'recent_cats') == true ) and ($conf['LLGBO_HEADER'][20] == 'false')) {$no_header = true;;}
    99          
    100         }
    101         //print_r($_GET.'----'.$page_name );
    102 if  ( strpos( $input,'index') == false )
    103          {if ( $page_name == 'index'   and ($conf['LLGBO_HEADER'][0] == 'false')) {$no_header = true;}// home
    104          if ( $page_name == 'picture' and  $conf['LLGBO_HEADER'][5] == 'false')  {$no_header = true;}//picture page
    105          if ( $page_name == 'tags' and  $conf['LLGBO_HEADER'][11] == 'false')  {$no_header = true;}//tags
    106          if ( $page_name == 'search' and  $conf['LLGBO_HEADER'][13] == 'false')  {$no_header = true;}//search   
    107          if ( $page_name == 'comments' and  $conf['LLGBO_HEADER'][14] == 'false')  {$no_header = true;}//comments
    108          if ( $page_name == 'about' and  $conf['LLGBO_HEADER'][15] == 'false')  {$no_header = true;}//about     
    109          if ( $page_name == 'notification' and  $conf['LLGBO_HEADER'][16] == 'false')  {$no_header = true;}//notification       
    110          if ( $page_name == 'register' and  $conf['LLGBO_HEADER'][17] == 'false')  {$no_header = true;} //notification   
    111          if ( $page_name == 'identification' and  $conf['LLGBO_HEADER'][18] == 'false')  {$no_header = true;}//about     
    112          }
    113  if ($no_header == true)
    114 {$template->append('head_elements','<!-- llgbo -->'."\n".'<STYLE type="text/css">'."\n".'#theHeader{display: none}'."\n".'header_msgs {position:static}'."\n".'</STYLE>');}
    115 }       
    116  
     60include_once(LLGBO_PATH.'include/manage_header.php');
    11761}  // end header
    118  
    11962//-------------------------------------------------------------
    12063//* IMPROVE FUNCTIONNALITIES --> PICTURE.TPL
    12164//-------------------------------------------------------------
    122 function  DisplayGboLook()
    123 { global $template,$conf,$lang;
    124 $ThePicture = $template->get_template_vars('current');
    125 // 2.1.f fix notice with video
    126 if ($ThePicture['is_picture'] <> 1 ) 
    127         {  $lang['Show file metadata'] =  'No Metadata';
    128                 return;}
    129 // ---------------------------         
    130     $meta = "";
     65function  llgbo_EndPicture()
     66{ global $template,$conf;
     67$infofile = $template->get_template_vars('INFO_FILE');
     68// ---- Metadata ----------     
     69$pictExt = substr($infofile,-3);
     70if (!in_array ( $pictExt,$conf['picture_ext']))
     71        {$lang['Show file metadata'] =  'No Metadata';}
     72        else
     73        {$meta = "";
    13174        $u_metadata = $template->get_template_vars('U_METADATA');
    132         $swt =   ' swttips="'; 
     75        $swt = "";
    13376         If ($conf['LLGBO_SETTINGS'] [2]  == 'true' )  // exif under bt
    13477                {  $metadata = $template->get_template_vars('metadata');
    135                 if(is_array($metadata))
    136                         {       if (isset($metadata[0]) and is_array($metadata[0]))
    137                                 { foreach($metadata[0] as $cle =>$tableau)
    138                                          { if(is_array($tableau))
     78                if (is_array($metadata))
     79                  {  if (isset($metadata[0]) and is_array($metadata[0]))
     80                                {foreach($metadata[0] as $cle =>$tableau)
     81                                        { if(is_array($tableau))
    13982                                         {   foreach($tableau as $cle=>$valeur)
    140                                                 {   $swt= $swt.$cle.' : '.$valeur.'<br>';
    141                                                         $meta = 1;}
    142                                         }       }
     83                                                {   $swt= $swt.$cle.' : '.$valeur.'||';
     84                                                        $meta = 1;} }   }
    14385                                        if  ( pwg_get_session_var('show_metadata') == 1 )
    14486                                        {       $lang['Show file metadata'] =  'EXIF Metadata';
    145                                                 if ($meta  != 1 ) {$lang['Show file metadata'] =  'No Metadata';}}
    146                                        
    147                                         $template->assign( 'U_METADATA', $u_metadata.'"'.$swt);
    148                                
    149                                  unset( $metadata[0]);
    150                                  $template->Clear_assign('metadata');// hide original metadata 
    151                                  $template->assign('metadata',$metadata);//  original metadata item > 0
    152                                 }       
    153                         }
    154                 }
    155                
     87                                                 if (isset($metadata[0] ['TITLE'])) // advanced meta
     88                                                {$lang['Show file metadata']    = $metadata [0] ['TITLE'];}
     89                                                if ($meta  != 1 ) {$lang['Show file metadata'] =  'No Metadata';}
     90                                        }
     91                                        $template->assign( 'U_METADATA', $u_metadata.'" title="'.$lang['Show file metadata']."||".$swt);
     92                                        unset( $metadata[0]);
     93                                         $template->Clear_assign('metadata');// hide original metadata 
     94                                         $template->assign('metadata',$metadata);} //  original metadata item > 0       
     95                  }
     96                  else
     97                  {if  ( pwg_get_session_var('show_metadata') == 1 )
     98                  {$lang['Show file metadata'] =  'No Metadata';
     99                   $template->assign( 'U_METADATA', $u_metadata.'" title="'.$lang['Show file metadata']);}
     100                   }
     101                }
     102        }       
     103        // Add llgbo requirement to ELEMENT_CONTENT
     104        $template->set_filenames( array('llgbo_content'=> dirname(__FILE__).'/template/llgbo_content.tpl') );
     105        $template->concat('ELEMENT_CONTENT', $template->parse('llgbo_content', true));
    156106}
    157107//-----------------------------------------------------------------
    158 /*  ------   MANAGE PICTURE PAGE----------------    */
     108/*  ------   MANAGE PICTURE PAGE                --------------    */
    159109//-----------------------------------------------------------------
    160 function MyPictureOptions($content )
     110function llgbo_RenderContent($content,$element_info )
    161111{global $template,$conf,$user,$lang;   
    162112$template->assign('LLGBO_PATH',LLGBO_PATH);
    163 $sweetcss = ' <! --- LLGBO tooltip css-->
    164 <style type="text/css">
    165 div#toolTip {position:absolute;z-index:1000;width:'.$conf['LLGBO_TOOLTIP'][0].'px;background:'.$conf['LLGBO_TOOLTIP'][3].';color:'.$conf['LLGBO_TOOLTIP'][5].';border:'.$conf['LLGBO_TOOLTIP'][1].'px solid '.$conf['LLGBO_TOOLTIP'][2].';padding:5px;min-height:1em;-moz-border-radius:5px}
    166 div#toolTip p {margin:0;padding:0;color:'.$conf['LLGBO_TOOLTIP'][5].';font-size:0.8em;font-family:Verdana,Arial,Helvetica,sans-serif;text-align:left}
    167 div#toolTip p em {display:block;margin-top:3px;font-style:normal;font-weight:bold;text-align:left}
    168 div#toolTip p.title {color:'.$conf['LLGBO_TOOLTIP'][4].';text-align:center;padding:0 0 3px 0;}
    169 #theImage{margin:auto;overflow: hidden;}
    170 </style>';
     113include_once(LLGBO_PATH.'/css/sweettitles.css.php');
     114include_once(LLGBO_PATH.'/css/gbolook.css.php');
    171115//-----------------------------------------------------------------
    172 // -----------  add JS tooltip in footer --------------------
     116// -----------  add CSS tooltip in footer --------------------
    173117//-----------------------------------------------------------------
    174  If (($conf['LLGBO'][1]  == 'true' ) /*  tooltip  */  or  ($conf['LLGBO_SETTINGS'] [2]  == 'true' )  /* exif under bt */
    175  or  ($conf['LLGBO_SETTINGS'] [4]  === 'true' ) /* usemap and Display Thumb  */)
    176             {  $template->assign('LLGBOTOOLTIP', 1 );   
    177                 $template->append('footer_elements',$sweetcss);
    178         }
    179 //-----------------------------------------------------------------
    180 // Navigation improvement are always available
    181 //-----------------------------------------------------------------
    182 $ThePicture = $template->get_template_vars('current');
    183 $next  = $template->get_template_vars('next');
    184 $prev = $template->get_template_vars('previous');
    185 $last = $template->get_template_vars('last');
    186 $first = $template->get_template_vars('first');
    187 $swtimg =   ' swttips="<center><img src=';     
    188 $nextthumb_title = $next['TITLE'];
    189 $prevthumb_title = $prev['TITLE'];     
    190 $usemap ='';
    191 //----------------------------------------------------   
    192 //-------      Tooltip                        -------------     
    193 //----------------------------------------------------   
    194 If ($conf['LLGBO_SETTINGS'][1]  == 'true' )/*  tooltip  */
    195         { $nextthumb_title = $next['TITLE'];
    196         $prevthumb_title = $prev['TITLE'];
    197         if (isset($first)){$template->assign('first',  array('TITLE' =>  $first['TITLE'].'"'.$swtimg.$first['THUMB_SRC'].'>',
    198                                                                                 'U_IMG' =>  $first['U_IMG']));}
    199           if (isset($prev)){$template->assign('previous',  array('TITLE' =>  $prev['TITLE'].'"'.$swtimg.$prev['THUMB_SRC'].'>',
    200                                                                                 'U_IMG' =>  $prev['U_IMG'], 'THUMB_SRC' => $prev['THUMB_SRC'])); }
    201           if (isset($next)){$template->assign('next',  array('TITLE' =>  $next['TITLE'].'"'.$swtimg.$next['THUMB_SRC'].'>',
    202                                                                                 'U_IMG' =>  $next['U_IMG'], 'THUMB_SRC' => $next['THUMB_SRC']));}
    203           if (isset($last)){$template->assign('last',  array('TITLE' =>  $last['TITLE'].'"'.$swtimg.$last['THUMB_SRC'].'>',
    204                                                                         'U_IMG' =>  $last['U_IMG']));}
    205         }       
    206 ///// YOGA or SIMPLE /////////////////////     
    207 $tpl_name = "";
    208 $tpl_name =   $user['theme'] ;
    209 /////////////////////////////////////////////
    210 // AN OTHER PLUGIN IS WORKING -> GO BACK
    211 //   - - - - - - - - - - - - - - - - - - - -
    212 if ( !empty($content) )   {  return $content;  }       
    213 //////////////////////////////////////////////////////////////////////
    214 // frame and navigation on picture  are only available on picture extension
    215 /////////////////////////////////////////////////////////////////       
    216 if ($ThePicture['is_picture'] <> 1 )    {  return $content;  ; }       
    217 //echo  strpos(strtoupper($tpl_name) , 'GALLY');
    218 
    219 //if (( strpos(strtoupper($tpl_name) , 'GALLY') === 0) )
    220 //      {       return $content;  ; }   // Not compliant with Gally
    221 /////////////////////////////////////////////////////////////////       
    222 If (($conf['LLGBO_SETTINGS'] [1]  == 'true' )/*  tooltip display  */  or ($conf['LLGBO_SETTINGS'] [0] == 'true') /*  frame  */  )
    223                         { $template->assign('LLGBOCSS', 2 );  }
    224 //----------------------------------------------------   
    225 //-------      Usemap   values         -------------     
    226 //----------------------------------------------------   
    227 If ($conf['LLGBO_SETTINGS'] [3]  == 'true' )  // usemap
    228  {      $usemap = '  usemap="#prevnext"' ;
    229         $imgw = $ThePicture['scaled_width'];
    230                 $imgh = $ThePicture['scaled_height'];   
    231                 $template->assign(array(
    232                         /* left --> Prev */     'LEFT_X1'  => 0,  'LEFT_Y1'  => 0,
    233                                                 'LEFT_X2'  => round($imgw * 0.24), 'LEFT_Y2'  => $imgh ,
    234                         /* up */                'UP_X1'  => round($imgw * 0.24) ,  'UP_Y1'  => 0,
    235                                                 'UP_X2'  => round($imgw * 0.76), 'UP_Y2'  => round($imgh * 0.50),
    236                         /* high */              'HIGH_X1'  => round($imgw * 0.24) , 'HIGH_Y1'  => round($imgh * 0.50) ,
    237                                                 'HIGH_X2'  => round($imgw * 0.76), 'HIGH_Y2'  => $imgh,
    238                         /* right -> next */     'RIGHT_X1'  => round($imgw * 0.76) , 'RIGHT_Y1'  => 0,
    239                                                 'RIGHT_X2'  =>  $imgw  , 'RIGHT_Y2'  => $imgh ));
    240                 $template->assign( 'USEMAP', 'ok'  );
    241                                                                
    242         If ($conf['LLGBO_SETTINGS'] [4]  === 'true' )  // usemap and Display Thumb
    243                         { $template->assign(array('NEXTTHUMB'  => $swtimg.$next['THUMB_SRC'].'>"',
    244                          'NEXTTHUMBTITLE'  => $nextthumb_title,
    245                          'PREVTHUMB'  =>  $swtimg.$prev['THUMB_SRC'].'>"',
    246                          'PREVTHUMBTITLE'  =>  $prevthumb_title));}
    247 }  // end usemap
     118 If (($conf['LLGBO'][1]  == 'true' ) /*  tooltip  */ 
     119 or  ($conf['LLGBO_SETTINGS'] [2]  == 'true' )  /* exif under bt */ )   
     120        {       $template->append('footer_elements',$sweetcss);
     121        $template->append('llgbo', array( 'TOOLTIP' => 'ok' ), true);}
     122       
     123/*       If ($conf['LLGBO_SETTINGS'] [3]  == 'true' )    switch free    {}  */
    248124
    249125//-----------------------------------------------------------------
    250 $template->assign( array(
    251            'SRC_IMG' => $ThePicture['image_url'],
    252            'WIDTH_IMG' => $ThePicture['scaled_width'],
    253            'HEIGHT_IMG' => $ThePicture['scaled_height'],           
    254            'ALT_IMG' =>  $ThePicture['file'],
    255        'MAP_TO_USED' =>   $usemap         
    256            ));
    257  
    258 If (isset($ThePicture['has_high'])and isset($ThePicture['high_url']))
    259                 {  $uuid = uniqid(rand());
    260                  $template->assign(
    261                  'high', array(
    262                                 'U_HIGH' => $ThePicture['high_url'] ,
    263                                 'UUID'   => $uuid,      ));
    264                 // compliance HD Shadowbox     
    265                 If ($conf['LLGBO_SETTINGS'] [9]  == 'true' )
    266                         {$nbarea = 3;
    267                          if (!isset($next)){$nbarea = 2;}
    268                          if (!isset($prev)){$nbarea = 2;}
    269                          $template->assign('HDHREF', ' href="'.$ThePicture['high_url'].'" title= "'.$lang['llgbo_dispinshadowbox'].$ThePicture['name'].'"');
    270                           $template->append('head_elements', "\n".'<script type="text/javascript">'."\n".'window.onload = function() {'."\n".'Shadowbox.setup(document.getElementById("prevnext").getElementsByTagName("area")['.$nbarea.']);}'."\n".'</script>'  );}
    271            else
    272            {$template->assign('HDHREF','title="'.$lang['Click on the photo to see it in high definition'].'" href="javascript:phpWGOpenWindow('."'".$ThePicture['high_url']."','".$uuid."','"."scrollbars=yes,toolbar=no,status=no,resizable=yes'".')"');}                 
    273                        
    274 }
     126// AN OTHER PLUGIN IS WORKING -> GO BACK
     127if ( !empty($content) )   {  return $content;  }       
     128// frame and navigation on picture  are only available on picture extension     
     129$pictExt = substr($element_info['file'],-3);
     130if (!in_array ( $pictExt,$conf['picture_ext'])) {  return $content;  ; }       
     131 include_once(LLGBO_PATH.'include/manage_picture_content.php');
     132} //end --> llgbo_RenderContent
    275133
    276 If (($conf['LLGBO_SETTINGS'] [5]  == 'true' )  /* title on frame */ and ($conf['LLGBO_SETTINGS'] [0]  == 'true' )) // display frame
    277          { $template->assign('SHOW_PICTURE_NAME_ON_TITLE', false);     
    278                 $template->assign('TITLE_FRAME_COLOR', $conf['LLGBO_FRAME'][0]);                 }
    279                
    280 // compatibility with extended description
    281 $comment = $template->get_template_vars('COMMENT_IMG');
    282 if (!isset($comment) )
    283                 {$template->assign( 'COMMENT_IMG' , $ThePicture['comment']);}
    284 //----------------------------------------------------   
    285 /*              HTML  frame                          */
    286 //----------------------------------------------------   
    287 If (($conf['LLGBO_SETTINGS'] [0] == 'true') )
    288         {   $bds = 0;
    289                 $frame_begin ='';
    290                 $frame_end='';
    291                 for ($x = 1   ;$x < 32  ; $x =$x +2)
    292                 {       if ((isset($conf['LLGBO_FRAME'][$x+1])) and  ($conf['LLGBO_FRAME'][$x+1] > 0))  // boder value > 0     
    293                           {$frame_begin = '<div id ="llgboframe'.$x.'" style="border: '.$conf['LLGBO_FRAME'][$x+1].'px solid '.$conf['LLGBO_FRAME'][$x].'">'."\n".$frame_begin;
    294                                 $bds =  $bds + $conf['LLGBO_FRAME'][$x+1];      //define border sum     
    295                                 $frame_end = $frame_end .' </div>';
    296                         }
    297                 }
    298                 $frame_width = $ThePicture["scaled_width"] + (2 * $bds);
    299                 $frame_height = $ThePicture["scaled_height"] + (2 * $bds);
    300         $template->assign('FRAME_SIZE','style="width:'.$frame_width .'px; height:'.$frame_height.'px;"');
    301         $template->assign('FRAME_BEGIN', $frame_begin);
    302         $template->assign('FRAME_END', $frame_end);
    303 // title on frame       
    304     If ($conf['LLGBO_SETTINGS'] [5]  == 'true' )  // title on frame
    305                 {$template->assign( array( 'TITLE_FRAME' => $ThePicture['name'] )); }   
    306         }       // end frame
    307         else
    308         // no frame
    309 {$template->clear_assign('FRAME_BEGIN') ;}
     134function LLGBO_prefilter_Frame($content, &$smarty)
     135{ //  begin frame
     136 $search = '<img src="';
     137  $replacement = '{if isset($llgbo.TITLE_FRAME)}'."\n".'<span  id="gboh2" style ="background:transparent;z-index:3;color:{$llgbo.TITLE_FRAME_COLOR}">{$llgbo.TITLE_FRAME}</span>';
     138  $replacement = $replacement."\n".'{/if}'."\n".'<div  id="gbo" {$llgbo.FRAME_SIZE}>'."\n".'{$llgbo.FRAME_BEGIN}'."\n".$search;
     139  $step1 = str_replace($search, $replacement, $content);
     140//  End frame   
     141  $search = '{foreach from=$current.unique_derivatives item=derivative key=derivative_type}{strip}';
     142  $replacement = '{$llgbo.FRAME_END}'."\n"."</div> <!-- end GBO frame -->"."\n".$search;
     143    return str_replace($search, $replacement, $step1);
     144}
    310145
    311 $template->set_filenames( array('default_content'=> dirname(__FILE__).'/template/picture_content.tpl') );
    312 return $template->parse( 'default_content', true);
    313 } //end --> MyPictureOptions
    314 } // End class
    315        
    316146/* trigger à intercepter                                   */
    317 add_event_handler('loc_begin_page_header', array(&$obj, 'MyBeginheader'));
    318 add_event_handler('loc_end_page_header', array(&$obj, 'Myheader'));
    319 Add_event_handler( 'loc_begin_picture', array(&$obj, 'AutoDisplayMetadata'));
    320 Add_event_handler( 'loc_end_picture', array(&$obj, 'DisplayGboLook'));
    321 add_event_handler('render_element_content',
    322   array(&$obj,'MyPictureOptions'),  EVENT_HANDLER_PRIORITY_NEUTRAL-1,  2  );
    323 add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') );
    324 set_plugin_data($plugin['id'], $obj);
    325 function afficher_tableau($tableau)
    326     {
    327     // on fait une boucle qui lit les éléments du tableau
    328     foreach ($tableau as $cle=>$valeur)
    329         {
    330         // si l'un des éléments est lui même un tableau
    331         // alors on applique la fonction à ce tableau
    332         if(is_array($valeur))
    333             {
    334             // on affiche le nom de la clé et
    335             // le début d'une liste pour
    336             //  décaler le contenu vers la droite
    337             print_r ($cle);
    338                          echo  ' : <ul>';
    339            
    340             // ici se réalise la récursivité
    341             // c'est à dire qu'on applique la fonction
    342             // à l'élément en cours car c'est lui aussi un tableau
    343             afficher_tableau($valeur);
    344            
    345             // on ferme la liste
    346             echo '</ul>';
    347             }
    348         }
    349     }
     147add_event_handler('loc_begin_page_header', 'llgbo_beginheader');
     148add_event_handler('loc_end_page_header', 'llgbo_endHeader');
     149Add_event_handler( 'loc_begin_picture','llgbo_BeginPicture');
     150Add_event_handler( 'loc_end_picture', 'llgbo_EndPicture');
     151add_event_handler('render_element_content', 'llgbo_RenderContent',  EVENT_HANDLER_PRIORITY_NEUTRAL-1, 20  );
     152add_event_handler('get_admin_plugin_menu_links',  'plugin_admin_menu' );
    350153?>
Note: See TracChangeset for help on using the changeset viewer.