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

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

[extensions] - see_photos_by_user

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=723
7Author: ddtddt
8Author URI:
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13define('SPBA_DIR' , basename(dirname(__FILE__)));
14define('SPBA_PATH' , PHPWG_PLUGINS_PATH . SPBA_DIR . '/');
15
16function 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
38function section_init_SPBA()
39{
40  global $tokens;
41  if (in_array('See_photos_by_user', $tokens))
42  include(SPBA_PATH . 'pagespba.php');
43}
44
45add_event_handler('blockmanager_apply' , 'add_link_SPBA');
46add_event_handler('loc_end_section_init', 'section_init_SPBA');
47
48
49?>
Note: See TracBrowser for help on using the repository browser.