Ignore:
Timestamp:
Mar 19, 2016, 6:33:31 AM (8 years ago)
Author:
ddtddt
Message:

[extensions] - see_photos_by_user - 2.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/see_photos_by_user/main.inc.php

    r30497 r31460  
    11<?php
    2 
    32/*
    43  Plugin Name: See photos by user
     
    76  Plugin URI: http://piwigo.org/ext/extension_view.php?eid=723
    87  Author: ddtddt
    9   Author URI:
    10  */
     8Author 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// +-----------------------------------------------------------------------+
    1129
    1230if (!defined('PHPWG_ROOT_PATH'))
     
    1634define('SPBA_PATH', PHPWG_PLUGINS_PATH . SPBA_DIR . '/');
    1735define('SPBA_ADMIN',get_root_url().'admin.php?page=plugin-'.SPBA_DIR);
    18 load_language('plugin.lang', SPBA_PATH);
    1936
    2037include_once(SPBA_PATH . 'include/function.see.inc.php');
     38
     39add_event_handler('loading_lang', 'see_photos_by_user_loading_lang');     
     40function 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
    2146global $conf;
    2247
    2348/*init plugin - filter http*/
    2449add_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;
     50function section_init_SPBA(){
     51  global $tokens, $conf, $template;
    3152  if(strpbrk('user-', $_SERVER['REQUEST_URI'])!=false){
    3253    $testa = explode('user-', $_SERVER['REQUEST_URI']);
     
    5879    }
    5980  }
    60  
    61   //$template->assign('SPBA2', 'toto');
    6281  $template->set_filename('SPBA', realpath(SPBA_PATH . 'pagespba.tpl'));
    6382  $template->assign_var_from_handle('CONTENT', 'SPBA'); //2.6
    64  
    6583}
    66 
    67 
    68 
    6984
    7085/*Schow link in menu*/
     
    7388}
    7489
    75 function add_link_SPBA($menu_ref_arr) {
     90function add_link_SPBA($menu_ref_arr){
    7691    global $conf, $user;
    7792    $menu = & $menu_ref_arr[0];
    7893    if (($block = $menu->get_block('mbSpecials')) != null) {
    79         load_language('plugin.lang', SPBA_PATH);
    8094        $position = (isset($conf['SPBA_position']) and is_numeric($conf['SPBA_position'])) ? $conf['SPBA_position'] : count($block->data) + 1;
    8195        array_splice
     
    92106    }
    93107}
    94 
    95108
    96109/*schow users menu*/
     
    137150
    138151function 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(
    148153    'NAME' => l10n('Photos by user'),
    149154    'URL' => SPBA_ADMIN,
    150155    );
    151 
    152  
    153     return $menu;
     156  return $menu;
    154157}
    155158
Note: See TracChangeset for help on using the changeset viewer.