[4292] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Look_like_gbo2 |
---|
[29005] | 4 | Version: 2.7.A |
---|
[4292] | 5 | Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=251 |
---|
[8867] | 6 | Author: GBo |
---|
[4292] | 7 | Author URI: http://www.photos.bouteyron.fr/ |
---|
| 8 | Description: Display thumbnail under button. Add navigation on picture look like GBo Gallery |
---|
| 9 | Add a border around picture ...... |
---|
[29049] | 10 | -- 01-07-2014 |
---|
[29484] | 11 | 2.7.A Compliance Piwigo 2.7 béta new administration management |
---|
| 12 | -- 10-09-2014 |
---|
| 13 | 2.7.A Compliance Piwigo 2.7rc1 new administration management |
---|
[12536] | 14 | */ |
---|
[4292] | 15 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
[14421] | 16 | |
---|
[28990] | 17 | // +-----------------------------------------------------------------------+ |
---|
| 18 | // | Plugin constants | |
---|
| 19 | // +-----------------------------------------------------------------------+ |
---|
| 20 | define('LLGBO_VERSION', '2.7.A'); |
---|
| 21 | define('LLGBO_ID', basename(dirname(__FILE__))); |
---|
| 22 | define('LLGBO_PATH' , PHPWG_PLUGINS_PATH . LLGBO_ID . '/'); |
---|
| 23 | define('LLGBO_ADMIN', get_root_url() . 'admin.php?page=plugin-' . LLGBO_ID); |
---|
| 24 | // +-----------------------------------------------------------------------+ |
---|
| 25 | /* Set the administration panel of the plugin */ |
---|
| 26 | // +-----------------------------------------------------------------------+ |
---|
| 27 | function llgbo_admin_menu($menu) |
---|
| 28 | { |
---|
| 29 | $menu[] = array( |
---|
| 30 | 'NAME' => 'Look like Gbo', |
---|
| 31 | 'URL' => LLGBO_ADMIN, |
---|
| 32 | ); |
---|
| 33 | return $menu; |
---|
| 34 | } |
---|
| 35 | // +-----------------------------------------------------------------------+ |
---|
| 36 | // | Plugin initialization | |
---|
| 37 | // +-----------------------------------------------------------------------+ |
---|
| 38 | function llgbo_init() |
---|
| 39 | { |
---|
[29005] | 40 | global $conf; |
---|
[29019] | 41 | load_language('plugin.lang', LLGBO_PATH); |
---|
[29005] | 42 | |
---|
| 43 | $conf['LLGBO2'] = safe_unserialize($conf['LLGBO2_Settings']); |
---|
| 44 | } |
---|
[28990] | 45 | /******************************************************************/ |
---|
[4713] | 46 | /* ALWAYS DISPLAY METADATA */ |
---|
[28990] | 47 | /******************************************************************/ |
---|
[14421] | 48 | function llgbo_BeginPicture() |
---|
[28990] | 49 | /******************************************************************/ |
---|
[29005] | 50 | {global $conf,$template; |
---|
| 51 | If ($conf['LLGBO2']['exifunderbt']) // exif under bt |
---|
[28990] | 52 | {$_GET['metadata'] = 'O';} |
---|
| 53 | |
---|
[29005] | 54 | If ($conf['LLGBO2']['alwaysdisplayexif']) //always display metadata |
---|
[28990] | 55 | {if ( pwg_get_session_var('show_metadata') == null ) |
---|
| 56 | { pwg_set_session_var('show_metadata', 1 ); } |
---|
| 57 | } |
---|
[29049] | 58 | } |
---|
| 59 | // --------------- end begin picture |
---|
[28990] | 60 | /******************************************************************/ |
---|
| 61 | // MANAGE BEGIN H E A D E R |
---|
| 62 | /******************************************************************/ |
---|
[14421] | 63 | function llgbo_beginheader() |
---|
[28990] | 64 | /******************************************************************/ |
---|
[29005] | 65 | { global $page,$conf; |
---|
| 66 | If ($conf['LLGBO2']['exifunderbt'] ) // reset nofollow, noindex |
---|
[4523] | 67 | { unset ($page['meta_robots']);} |
---|
[4292] | 68 | } |
---|
[28990] | 69 | /******************************************************************/ |
---|
[4713] | 70 | // MANAGE H E A D E R |
---|
[28990] | 71 | /******************************************************************/ |
---|
[14421] | 72 | function llgbo_endHeader() |
---|
[28990] | 73 | /******************************************************************/ |
---|
[29049] | 74 | {include_once(LLGBO_PATH.'include/manage_header.php'); |
---|
[28990] | 75 | } // --------------- end header |
---|
| 76 | /******************************************************************/ |
---|
[4713] | 77 | //* IMPROVE FUNCTIONNALITIES --> PICTURE.TPL |
---|
[28990] | 78 | /******************************************************************/ |
---|
[14421] | 79 | function llgbo_EndPicture() |
---|
[28990] | 80 | /******************************************************************/ |
---|
[29049] | 81 | { global $template,$conf,$lang; |
---|
| 82 | if (!empty($conf['LLGBO2']['is-picture'])) |
---|
| 83 | { // ---- Metadata ---------- |
---|
| 84 | if ($conf['LLGBO2']['exifunderbt']) // exif under bt |
---|
| 85 | { $metadata = $template->get_template_vars('metadata'); |
---|
| 86 | if (is_array($metadata[0])) |
---|
| 87 | { |
---|
| 88 | if ($metadata [0] ['TITLE'] == $lang['EXIF Metadata'] ) // only exif are displayed under buton |
---|
| 89 | {$u_metadata = $template->get_template_vars('U_METADATA'); |
---|
| 90 | $swt = ''; |
---|
| 91 | foreach($metadata[0]['lines'] as $cle=>$valeur){$swt= $swt.$cle.' : '.$valeur.'||';} |
---|
| 92 | if ( pwg_get_session_var('show_metadata') == 1 ) |
---|
| 93 | { $lang['Show file metadata'] = $metadata [0] ['TITLE'];} |
---|
| 94 | $template->assign( 'U_METADATA',$u_metadata.'" title="'.$lang['Show file metadata']."||".$swt); |
---|
| 95 | unset( $metadata[0]); |
---|
| 96 | $template->Clear_assign('metadata');// hide all original metadata |
---|
| 97 | $template->assign('metadata',$metadata); }// always display metadata elem > 0 |
---|
| 98 | } |
---|
| 99 | else |
---|
| 100 | {if (( pwg_get_session_var('show_metadata') == 1 ) and (!is_array($metadata))) |
---|
| 101 | {$template->Clear_assign( 'U_METADATA');} |
---|
| 102 | } |
---|
[16754] | 103 | } |
---|
[29049] | 104 | // -------------------------------------- |
---|
| 105 | // Add llgbo requirement to ELEMENT_CONTENT |
---|
| 106 | // -------------------------------------- |
---|
| 107 | $template->set_filenames( array('llgbo_content'=> dirname(__FILE__).'/template/llgbo_content.tpl') ); |
---|
| 108 | $template->concat('picture', $template->parse('llgbo_content', true)); |
---|
| 109 | } |
---|
[4292] | 110 | } |
---|
[28990] | 111 | |
---|
| 112 | /****************************************************************** |
---|
| 113 | ------ MANAGE PICTURE PAGE -------------- |
---|
| 114 | ******************************************************************/ |
---|
[14421] | 115 | include_once(LLGBO_PATH.'include/manage_picture_content.php'); |
---|
[29049] | 116 | /******************************************************************/ |
---|
[6234] | 117 | |
---|
[28990] | 118 | /******************************************************************/ |
---|
| 119 | // trigger à intercepter |
---|
| 120 | /******************************************************************/ |
---|
| 121 | add_event_handler('init', 'llgbo_init'); |
---|
| 122 | if (defined('IN_ADMIN')) |
---|
[29049] | 123 | { add_event_handler('get_admin_plugin_menu_links', 'llgbo_admin_menu'); } |
---|
[28990] | 124 | else |
---|
[29049] | 125 | { add_event_handler('loc_begin_page_header', 'llgbo_beginheader'); |
---|
[28990] | 126 | add_event_handler('loc_end_page_header', 'llgbo_endHeader'); |
---|
[29049] | 127 | add_event_handler('loc_begin_picture','llgbo_BeginPicture'); |
---|
| 128 | add_event_handler('loc_end_picture', 'llgbo_EndPicture'); |
---|
| 129 | add_event_handler('render_element_content', 'llgbo_RenderContent', EVENT_HANDLER_PRIORITY_NEUTRAL, 20 ); |
---|
[28990] | 130 | } |
---|
[4292] | 131 | ?> |
---|