'Look_like_GBo', 'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/llgbo_admin.php') )); return $menu; } //------------------------------------------------------------- /* ALWAYS DISPLAY METADATA */ //------------------------------------------------------------- function llgbo_BeginPicture() {global $conf,$template; If ($conf['LLGBO_SETTINGS'] [2] == 'true' ) // exif under bt {$_GET['metadata'] = 'O';} If ($conf['LLGBO_SETTINGS'][10] == 'true' ) //always display metadata {if ( pwg_get_session_var('show_metadata') == null ) { pwg_set_session_var('show_metadata', 1 ); }} } function llgbo_beginheader() { global $page,$conf; If ($conf['LLGBO_SETTINGS'][2] == 'true' ) // reset nofollow, noindex { unset ($page['meta_robots']);} } //------------------------------------------------------------- // MANAGE H E A D E R //------------------------------------------------------------- function llgbo_endHeader() {global $template,$conf; $page_name = script_basename(); include_once(LLGBO_PATH.'include/manage_header.php'); } // end header //------------------------------------------------------------- //* IMPROVE FUNCTIONNALITIES --> PICTURE.TPL //------------------------------------------------------------- function llgbo_EndPicture() { global $template,$conf,$page; $infofile = $template->get_template_vars('INFO_FILE'); $current = $template->get_template_vars('current'); //---------------------------------------------------- /* HTML End frame on Picture.tpl */ //---------------------------------------------------- If (($conf['LLGBO_SETTINGS'] [0] == 'true') //Frame and ($conf['LLGBO_RENDERCONTENT'] == 'true') ) // $content ok for update { $target = 'picture'; if ($page['slideshow'] and $conf['light_slideshow']) { $target = 'slideshow';} $template->set_prefilter($target, 'LLGBO_prefilter_Picture_Frame'); If (isset($conf['LLGBO_SETTINGS'] ['rirs'])) { // Force javascript LlgboFr_Resize to Read MainImage Reel Size via URL // Must be used when html image is already resize by HTML (IE or Chrome) If ($conf['LLGBO_SETTINGS'] ['rirs'] == 'true') // Forcce javascript to read Image reel size {$template->append('llgbo', array('READIMGREELSIZE' => "ok"), true); } } // selected picture Size $PictSizeWH = $current['selected_derivative']->get_size(); $frame_width = $PictSizeWH[0]; $frame_height = $PictSizeWH[1]; $lastbrdpx = 0; $frame_begin =''; for ($x = 1 ;$x < 32 ; $x =$x +2) { if ((isset($conf['LLGBO_FRAME'][$x+1])) and ($conf['LLGBO_FRAME'][$x+1] > 0)) // boder value > 0 { $bordpx= $conf['LLGBO_FRAME'][$x+1]; $frame_width = $frame_width + ( 2* $lastbrdpx); $frame_height = $frame_height + ( 2* $lastbrdpx); $bordcolor = $conf['LLGBO_FRAME'][$x]; $frame_begin = '
'."\n".$frame_begin; $lastbrdpx = $bordpx;} } $frame_width = $frame_width + ( 2* $lastbrdpx); $frame_height = $frame_height + ( 2* $lastbrdpx); $frame_size = 'style="border:0 ;width:'.$frame_width.'px; height:'.$frame_height.'px;"'; $template->append('llgbo', array( 'FRAME_SIZE' => $frame_size, 'FRAME_BEGIN' => $frame_begin), true); If (($conf['LLGBO_SETTINGS'] [5] == 'true' ) /* title on frame */ and ($conf['LLGBO_SETTINGS'] [0] == 'true' ) )// frame { $template->append('llgbo', array( 'TITLE_FRAME_COLOR' => $conf['LLGBO_FRAME'][0], 'TITLE_FRAME' => $current['name'] ), true); $template->assign('SHOW_PICTURE_NAME_ON_TITLE' , false); } } //end frame // ---- Metadata ---------- $pictExt = substr($infofile,-3); if (!in_array ( $pictExt,$conf['picture_ext'])) {$lang['Show file metadata'] = 'No Metadata';} else { if ($conf['show_exif'] == true) // No exif ? {$meta = ""; $u_metadata = $template->get_template_vars('U_METADATA'); $swt = ""; If ($conf['LLGBO_SETTINGS'] [2] == 'true' ) // exif under bt { $metadata = $template->get_template_vars('metadata'); if (is_array($metadata)) { if (isset($metadata[0]) and is_array($metadata[0])) {foreach($metadata[0] as $cle =>$tableau) { if(is_array($tableau)) { foreach($tableau as $cle=>$valeur) { $swt= $swt.$cle.' : '.$valeur.'||'; $meta = 1;} } } if ( pwg_get_session_var('show_metadata') == 1 ) { $lang['Show file metadata'] = 'EXIF Metadata'; if (isset($metadata[0] ['TITLE'])) // advanced meta {$lang['Show file metadata'] = $metadata [0] ['TITLE'];} if ($meta != 1 ) {$lang['Show file metadata'] = 'No Metadata';} } $template->assign( 'U_METADATA', $u_metadata.'" title="'.$lang['Show file metadata']."||".$swt); unset( $metadata[0]); $template->Clear_assign('metadata');// hide original metadata $template->assign('metadata',$metadata);} // original metadata item > 0 } else {if ( pwg_get_session_var('show_metadata') == 1 ) {$lang['Show file metadata'] = 'No Metadata'; $template->assign( 'U_METADATA', $u_metadata.'" title="'.$lang['Show file metadata']);} } } } } // Add llgbo requirement to ELEMENT_CONTENT $template->set_filenames( array('llgbo_content'=> dirname(__FILE__).'/template/llgbo_content.tpl') ); $template->concat('ELEMENT_CONTENT', $template->parse('llgbo_content', true)); } //----------------------------------------------------------------- /* ------ MANAGE PICTURE PAGE -------------- */ //----------------------------------------------------------------- function llgbo_RenderContent($content,$element_info ) {global $template,$conf,$user,$lang,$themeconf; $template->assign('LLGBO_PATH',LLGBO_PATH); include_once(LLGBO_PATH.'/css/sweettitles.css.php'); //----------------------------------------------------------------- // ----------- add CSS tooltip in footer -------------------- //----------------------------------------------------------------- If (($conf['LLGBO_SETTINGS'][1] == 'true' ) /* tooltip */ or ($conf['LLGBO_SETTINGS'] [2] == 'true' ) /* exif under bt */ ) { $template->append('footer_elements',$sweetcss); $template->append('llgbo', array( 'TOOLTIP' => 'ok' ), true);} /* If ($conf['LLGBO_SETTINGS'] [3] == 'true' ) switch free {} */ $conf['LLGBO_RENDERCONTENT'] = 'false'; //----------------------------------------------------------------- // AN OTHER PLUGIN IS WORKING -> GO BACK if ( !empty($content) ) { return $content; } // frame and navigation on picture are only available on picture extension $pictExt = substr($element_info['file'],-3); if (!in_array ( $pictExt,$conf['picture_ext'])) { return $content; ; } $conf['LLGBO_RENDERCONTENT'] = 'true'; // $content ok for update include_once(LLGBO_PATH.'include/manage_picture_content.php'); } //end --> llgbo_RenderContent function LLGBO_prefilter_Content_Frame($content, &$smarty) { // End frame picture_content TPL global $themeconf; $search = '{foreach from=$current.unique_derivatives'; $replacement = "\n".'{$llgbo.FRAME_END}'."\n"."
"."\n".$search; if (( strpos(strtoupper($themeconf['name']) , 'STRIPPED') === 0) ) {$search = 'class="hideTabs">'; $replacement = $search."\n".'{$llgbo.FRAME_END}'."\n"." ";} return str_replace($search, $replacement, $content); } function LLGBO_prefilter_Picture_Frame($content, &$smarty) { // ------------------------ // begin frame on picture TPL $search = '{$ELEMENT_CONTENT}'; $replacement = '{if isset($llgbo.TITLE_FRAME)}'."\n".'{$llgbo.TITLE_FRAME}'; $replacement = $replacement."\n".'{/if}'."\n".'
'."\n".'{$llgbo.FRAME_BEGIN}'."\n".$search; // ------------------------ return str_replace($search, $replacement, $content); } /* trigger à intercepter */ add_event_handler('loc_begin_page_header', 'llgbo_beginheader'); add_event_handler('loc_end_page_header', 'llgbo_endHeader'); Add_event_handler( 'loc_begin_picture','llgbo_BeginPicture'); Add_event_handler( 'loc_end_picture', 'llgbo_EndPicture'); add_event_handler('render_element_content', 'llgbo_RenderContent', EVENT_HANDLER_PRIORITY_NEUTRAL-1, 20 ); add_event_handler('get_admin_plugin_menu_links', 'plugin_admin_menu' ); ?>