[26635] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: See photos by user |
---|
| 4 | Version: auto |
---|
| 5 | Description: See photos by user |
---|
[26636] | 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=723 |
---|
[26635] | 7 | Author: ddtddt |
---|
| 8 | Author URI: |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | define('SPBA_DIR' , basename(dirname(__FILE__))); |
---|
| 15 | define('SPBA_PATH' , PHPWG_PLUGINS_PATH . SPBA_DIR . '/'); |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | function add_link_SPBA($menu_ref_arr) |
---|
| 19 | { |
---|
| 20 | global $conf, $user; |
---|
| 21 | |
---|
| 22 | $menu = & $menu_ref_arr[0]; |
---|
| 23 | |
---|
| 24 | if (($block = $menu->get_block('mbSpecials')) != null) |
---|
| 25 | { |
---|
| 26 | load_language('plugin.lang', SPBA_PATH); |
---|
| 27 | |
---|
| 28 | $position = (isset($conf['SPBA_position']) and is_numeric($conf['SPBA_position'])) ? $conf['SPBA_position'] : count($block->data)+1; |
---|
| 29 | |
---|
| 30 | array_splice($block->data, $position-1, 0, array('See_photos_by_user' => |
---|
| 31 | array( |
---|
| 32 | 'URL' => make_index_url(array('section' => 'See_photos_by_user')), |
---|
| 33 | 'TITLE' => l10n('See photos by user'), |
---|
| 34 | 'NAME' => l10n('See photos by user') |
---|
| 35 | ) |
---|
| 36 | ) |
---|
| 37 | ); |
---|
| 38 | } |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | function section_init_SPBA() |
---|
| 42 | { |
---|
| 43 | global $tokens; |
---|
| 44 | if (in_array('See_photos_by_user', $tokens)) |
---|
| 45 | include(SPBA_PATH . 'pagespba.php'); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | add_event_handler('blockmanager_apply' , 'add_link_SPBA'); |
---|
| 49 | add_event_handler('loc_end_section_init', 'section_init_SPBA'); |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | ?> |
---|