source: extensions/see_photos_by_user/main.inc.php @ 26635

Revision 26635, 1.2 KB checked in by ddtddt, 6 years ago (diff)

[extensions] - see_photos_by_user - first commit

Line 
1<?php
2/*
3Plugin Name: See photos by user
4Version: auto
5Description: See photos by user
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
7Author: ddtddt
8Author URI:
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13
14define('SPBA_DIR' , basename(dirname(__FILE__)));
15define('SPBA_PATH' , PHPWG_PLUGINS_PATH . SPBA_DIR . '/');
16
17
18function 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
41function section_init_SPBA()
42{
43  global $tokens;
44  if (in_array('See_photos_by_user', $tokens))
45    include(SPBA_PATH . 'pagespba.php');
46}
47
48add_event_handler('blockmanager_apply' , 'add_link_SPBA');
49add_event_handler('loc_end_section_init', 'section_init_SPBA');
50
51
52?>
Note: See TracBrowser for help on using the repository browser.