Changeset 31460 for extensions/see_photos_by_user/main.inc.php
- Timestamp:
- Mar 19, 2016, 6:33:31 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/see_photos_by_user/main.inc.php
r30497 r31460 1 1 <?php 2 3 2 /* 4 3 Plugin Name: See photos by user … … 7 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=723 8 7 Author: ddtddt 9 Author URI: 10 */ 8 Author URI: http://temmii.com/piwigo/ 9 */ 10 // +-----------------------------------------------------------------------+ 11 // | See photos by user plugin for piwigo | 12 // +-----------------------------------------------------------------------+ 13 // | Copyright(C) 2014 - 2016 ddtddt http://temmii.com/piwigo/ | 14 // +-----------------------------------------------------------------------+ 15 // | This program is free software; you can redistribute it and/or modify | 16 // | it under the terms of the GNU General Public License as published by | 17 // | the Free Software Foundation | 18 // | | 19 // | This program is distributed in the hope that it will be useful, but | 20 // | WITHOUT ANY WARRANTY; without even the implied warranty of | 21 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 22 // | General Public License for more details. | 23 // | | 24 // | You should have received a copy of the GNU General Public License | 25 // | along with this program; if not, write to the Free Software | 26 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 27 // | USA. | 28 // +-----------------------------------------------------------------------+ 11 29 12 30 if (!defined('PHPWG_ROOT_PATH')) … … 16 34 define('SPBA_PATH', PHPWG_PLUGINS_PATH . SPBA_DIR . '/'); 17 35 define('SPBA_ADMIN',get_root_url().'admin.php?page=plugin-'.SPBA_DIR); 18 load_language('plugin.lang', SPBA_PATH);19 36 20 37 include_once(SPBA_PATH . 'include/function.see.inc.php'); 38 39 add_event_handler('loading_lang', 'see_photos_by_user_loading_lang'); 40 function see_photos_by_user_loading_lang(){ 41 load_language('plugin.lang', SPBA_PATH); 42 load_language('lang', PHPWG_ROOT_PATH . 'local/', array('no_fallback' => true, 'local' => true)); 43 } 44 45 21 46 global $conf; 22 47 23 48 /*init plugin - filter http*/ 24 49 add_event_handler('loc_end_section_init', 'section_init_SPBA'); 25 function section_init_SPBA() { 26 /*init plugin lang*/ 27 load_language('plugin.lang', SPBA_PATH); 28 load_language('lang', PHPWG_ROOT_PATH . 'local/', array('no_fallback' => true, 'local' => true)); 29 30 global $tokens, $conf, $template; 50 function section_init_SPBA(){ 51 global $tokens, $conf, $template; 31 52 if(strpbrk('user-', $_SERVER['REQUEST_URI'])!=false){ 32 53 $testa = explode('user-', $_SERVER['REQUEST_URI']); … … 58 79 } 59 80 } 60 61 //$template->assign('SPBA2', 'toto');62 81 $template->set_filename('SPBA', realpath(SPBA_PATH . 'pagespba.tpl')); 63 82 $template->assign_var_from_handle('CONTENT', 'SPBA'); //2.6 64 65 83 } 66 67 68 69 84 70 85 /*Schow link in menu*/ … … 73 88 } 74 89 75 function add_link_SPBA($menu_ref_arr) 90 function add_link_SPBA($menu_ref_arr){ 76 91 global $conf, $user; 77 92 $menu = & $menu_ref_arr[0]; 78 93 if (($block = $menu->get_block('mbSpecials')) != null) { 79 load_language('plugin.lang', SPBA_PATH);80 94 $position = (isset($conf['SPBA_position']) and is_numeric($conf['SPBA_position'])) ? $conf['SPBA_position'] : count($block->data) + 1; 81 95 array_splice … … 92 106 } 93 107 } 94 95 108 96 109 /*schow users menu*/ … … 137 150 138 151 function SPBA_admin_menu($menu) { 139 /*load_language('plugin.lang', SPBA_PATH); 140 array_push( 141 $menu, array( 142 'NAME' => l10n('Photos by user'), 143 'URL' => get_admin_plugin_menu_link(SPBA_PATH . 'admin.php') 144 ) 145 );*/ 146 load_language('plugin.lang', SPBA_PATH); 147 $menu[] = array( 152 $menu[] = array( 148 153 'NAME' => l10n('Photos by user'), 149 154 'URL' => SPBA_ADMIN, 150 155 ); 151 152 153 return $menu; 156 return $menu; 154 157 } 155 158
Note: See TracChangeset
for help on using the changeset viewer.