'Look like Gbo', 'URL' => LLGBO_ADMIN, ); return $menu; } // +-----------------------------------------------------------------------+ // | Plugin initialization | // +-----------------------------------------------------------------------+ function llgbo_init() { global $conf; load_language('plugin.lang', LLGBO_PATH); $conf['LLGBO2'] = safe_unserialize($conf['LLGBO2_Settings']); // auto size must take care of frame size if (($conf['LLGBO2']['frame']) ) //Frame on { $framesize =0; foreach ($conf['LLGBO2']['FR-sizes'] as $cle => $value) { if ( $value > 0) { $framesize = $framesize + ( 2 * $value); } } if (defined('ASIZE_PATH')) { $conf['automatic_size_width_margin']= 12 + $framesize; $conf['automatic_size_height_margin']= 40 + $framesize; } } } /******************************************************************/ /* ALWAYS DISPLAY METADATA */ /******************************************************************/ function llgbo_BeginPicture() /******************************************************************/ {global $conf,$template; If ($conf['LLGBO2']['exifunderbt']) // exif under bt {$_GET['metadata'] = 'O';} If ($conf['LLGBO2']['alwaysdisplayexif']) //always display metadata {if ( pwg_get_session_var('show_metadata') == null ) { pwg_set_session_var('show_metadata', 1 ); } } } // --------------- end begin picture /******************************************************************/ // MANAGE BEGIN H E A D E R /******************************************************************/ function llgbo_beginheader() /******************************************************************/ { global $page,$conf; If ($conf['LLGBO2']['exifunderbt'] ) // reset nofollow, noindex { unset ($page['meta_robots']);} } /******************************************************************/ // MANAGE H E A D E R /******************************************************************/ function llgbo_endHeader() /******************************************************************/ {include_once(LLGBO_PATH.'include/manage_header.php'); } // --------------- end header /******************************************************************/ //* IMPROVE FUNCTIONNALITIES --> PICTURE.TPL /******************************************************************/ function llgbo_EndPicture() /******************************************************************/ { global $template,$conf,$lang; if (!empty($conf['LLGBO2']['is-picture'])) { // ---- Metadata ---------- if ($conf['LLGBO2']['exifunderbt']) // exif under bt { $metadata = $template->get_template_vars('metadata'); if (is_array($metadata[0])) { if ($metadata [0] ['TITLE'] == $lang['EXIF Metadata'] ) // only exif are displayed under buton {$u_metadata = $template->get_template_vars('U_METADATA'); $swt = ''; foreach($metadata[0]['lines'] as $cle=>$valeur){$swt= $swt.$cle.' : '.$valeur.'||';} if ( pwg_get_session_var('show_metadata') == 1 ) { $lang['Show file metadata'] = $metadata [0] ['TITLE'];} $template->assign( 'U_METADATA',$u_metadata.'" title="'.$lang['Show file metadata']."||".$swt); unset( $metadata[0]); $template->Clear_assign('metadata');// hide all original metadata $template->assign('metadata',$metadata); }// always display metadata elem > 0 } else {if (( pwg_get_session_var('show_metadata') == 1 ) and (!is_array($metadata))) {$template->Clear_assign( 'U_METADATA');} } } // -------------------------------------- // Add llgbo requirement to ELEMENT_CONTENT // -------------------------------------- $template->set_filenames( array('llgbo_content'=> dirname(__FILE__).'/template/llgbo_content.tpl') ); $template->concat('picture', $template->parse('llgbo_content', true)); } } /****************************************************************** ------ MANAGE PICTURE PAGE -------------- ******************************************************************/ include_once(LLGBO_PATH.'include/manage_picture_content.php'); /******************************************************************/ /******************************************************************/ // trigger à intercepter /******************************************************************/ add_event_handler('init', 'llgbo_init'); if (defined('IN_ADMIN')) { add_event_handler('get_admin_plugin_menu_links', 'llgbo_admin_menu'); } else { 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, 20 ); } ?>