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