Changeset 31459


Ignore:
Timestamp:
03/19/16 05:42:50 (4 years ago)
Author:
ddtddt
Message:

[extensions] - see_my_photos - 2.8

Location:
extensions/see_my_photos
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/see_my_photos/index.php

    r26641 r31459  
    11<?php 
    2 // +-----------------------------------------------------------------------+ 
    3 // | Piwigo - a PHP based picture gallery                                  | 
    4 // +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org | 
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net | 
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick | 
    8 // +-----------------------------------------------------------------------+ 
    9 // | This program is free software; you can redistribute it and/or modify  | 
    10 // | it under the terms of the GNU General Public License as published by  | 
    11 // | the Free Software Foundation                                          | 
    12 // |                                                                       | 
    13 // | This program is distributed in the hope that it will be useful, but   | 
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            | 
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      | 
    16 // | General Public License for more details.                              | 
    17 // |                                                                       | 
    18 // | You should have received a copy of the GNU General Public License     | 
    19 // | along with this program; if not, write to the Free Software           | 
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 
    21 // | USA.                                                                  | 
    22 // +-----------------------------------------------------------------------+ 
    23  
    242// Recursive call 
    253$url = '../'; 
  • extensions/see_my_photos/language/en_UK/index.php

    r26641 r31459  
    11<?php 
    2 // +-----------------------------------------------------------------------+ 
    3 // | Piwigo - a PHP based picture gallery                                  | 
    4 // +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org | 
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net | 
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick | 
    8 // +-----------------------------------------------------------------------+ 
    9 // | This program is free software; you can redistribute it and/or modify  | 
    10 // | it under the terms of the GNU General Public License as published by  | 
    11 // | the Free Software Foundation                                          | 
    12 // |                                                                       | 
    13 // | This program is distributed in the hope that it will be useful, but   | 
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            | 
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      | 
    16 // | General Public License for more details.                              | 
    17 // |                                                                       | 
    18 // | You should have received a copy of the GNU General Public License     | 
    19 // | along with this program; if not, write to the Free Software           | 
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 
    21 // | USA.                                                                  | 
    22 // +-----------------------------------------------------------------------+ 
    23  
    242// Recursive call 
    253$url = '../'; 
  • extensions/see_my_photos/language/en_UK/plugin.lang.php

    r26641 r31459  
    11<?php 
     2// +-----------------------------------------------------------------------+ 
     3// | See My Photos plugin for piwigo                                       | 
     4// +-----------------------------------------------------------------------+ 
     5// | Copyright(C) 2014 - 2016 ddtddt             http://temmii.com/piwigo/ | 
     6// +-----------------------------------------------------------------------+ 
     7// | This program is free software; you can redistribute it and/or modify  | 
     8// | it under the terms of the GNU General Public License as published by  | 
     9// | the Free Software Foundation                                          | 
     10// |                                                                       | 
     11// | This program is distributed in the hope that it will be useful, but   | 
     12// | WITHOUT ANY WARRANTY; without even the implied warranty of            | 
     13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      | 
     14// | General Public License for more details.                              | 
     15// |                                                                       | 
     16// | You should have received a copy of the GNU General Public License     | 
     17// | along with this program; if not, write to the Free Software           | 
     18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 
     19// | USA.                                                                  | 
     20// +-----------------------------------------------------------------------+ 
    221$lang['My photos'] = 'My photos'; 
    322?> 
  • extensions/see_my_photos/language/fr_FR/index.php

    r26641 r31459  
    11<?php 
    2 // +-----------------------------------------------------------------------+ 
    3 // | Piwigo - a PHP based picture gallery                                  | 
    4 // +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2008-2014 Piwigo Team                  http://piwigo.org | 
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net | 
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick | 
    8 // +-----------------------------------------------------------------------+ 
    9 // | This program is free software; you can redistribute it and/or modify  | 
    10 // | it under the terms of the GNU General Public License as published by  | 
    11 // | the Free Software Foundation                                          | 
    12 // |                                                                       | 
    13 // | This program is distributed in the hope that it will be useful, but   | 
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            | 
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      | 
    16 // | General Public License for more details.                              | 
    17 // |                                                                       | 
    18 // | You should have received a copy of the GNU General Public License     | 
    19 // | along with this program; if not, write to the Free Software           | 
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 
    21 // | USA.                                                                  | 
    22 // +-----------------------------------------------------------------------+ 
    23  
    242// Recursive call 
    253$url = '../'; 
  • extensions/see_my_photos/language/fr_FR/plugin.lang.php

    r26641 r31459  
    11<?php 
     2// +-----------------------------------------------------------------------+ 
     3// | See My Photos plugin for piwigo                                       | 
     4// +-----------------------------------------------------------------------+ 
     5// | Copyright(C) 2014 - 2016 ddtddt             http://temmii.com/piwigo/ | 
     6// +-----------------------------------------------------------------------+ 
     7// | This program is free software; you can redistribute it and/or modify  | 
     8// | it under the terms of the GNU General Public License as published by  | 
     9// | the Free Software Foundation                                          | 
     10// |                                                                       | 
     11// | This program is distributed in the hope that it will be useful, but   | 
     12// | WITHOUT ANY WARRANTY; without even the implied warranty of            | 
     13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      | 
     14// | General Public License for more details.                              | 
     15// |                                                                       | 
     16// | You should have received a copy of the GNU General Public License     | 
     17// | along with this program; if not, write to the Free Software           | 
     18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 
     19// | USA.                                                                  | 
     20// +-----------------------------------------------------------------------+ 
    221$lang['My photos'] = 'Mes photos'; 
    322?> 
  • extensions/see_my_photos/main.inc.php

    r27486 r31459  
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=722 
    77Author: ddtddt 
    8 Author URI:  
     8Author URI: http://temmii.com/piwigo/ 
    99*/ 
     10// +-----------------------------------------------------------------------+ 
     11// | See My Photos 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// +-----------------------------------------------------------------------+ 
    1029 
    1130if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     
    1837add_event_handler('loc_end_section_init', 'section_init_SMP'); 
    1938 
     39add_event_handler('loading_lang', 'see_my_photos_loading_lang');           
     40function see_my_photos_loading_lang(){ 
     41  load_language('plugin.lang', SMP_PATH); 
     42} 
    2043 
    21 function add_link_SMP($menu_ref_arr) 
    22  { 
     44 
     45function add_link_SMP($menu_ref_arr){ 
    2346  global $conf, $user; 
    24          
    25    $query = ' 
     47  $query = ' 
    2648  SELECT DISTINCT(id) 
    2749  FROM '.IMAGES_TABLE.' 
     
    3759    'WHERE' 
    3860  ).' 
    39   AND added_by = \''.$user['id'].'\' 
    40 ;'; 
     61  AND added_by = \''.$user['id'].'\';'; 
    4162  $result = pwg_query($query); 
    4263  $row = pwg_db_fetch_assoc($result); 
    43 $nbp=count(array_from_query($query, 'id')); 
    44  
    45  if (!is_a_guest() and !empty($row)) 
    46   {   
    47   $menu = & $menu_ref_arr[0]; 
    48   if (($block = $menu->get_block('mbSpecials')) != null) 
    49    { 
    50    load_language('plugin.lang', SMP_PATH); 
    51    $position = (isset($conf['SMP_position']) and is_numeric($conf['SMP_position'])) ? $conf['SMP_position'] : count($block->data)+1; 
    52    array_splice($block->data, $position-1, 0, array('see_my_photos' => 
    53       array( 
     64  $nbp=count(array_from_query($query, 'id')); 
     65  if (!is_a_guest() and !empty($row)){  
     66    $menu = & $menu_ref_arr[0]; 
     67    if (($block = $menu->get_block('mbSpecials')) != null){ 
     68          $position = (isset($conf['SMP_position']) and is_numeric($conf['SMP_position'])) ? $conf['SMP_position'] : count($block->data)+1; 
     69      array_splice($block->data, $position-1, 0, array('see_my_photos' => 
     70       array( 
    5471        'URL' => make_index_url(array('section' => 'see_my_photos')), 
    5572        'TITLE' => l10n('My photos'), 
    5673        'NAME' => l10n('My photos').' ('.$nbp.')', 
    57         ) 
    58       ) 
    59     ); 
    60    } 
    61         } 
     74      ))); 
     75    } 
     76  } 
    6277} 
    6378 
    64 function section_init_SMP() 
    65  { 
    66  global $tokens; 
     79function section_init_SMP(){ 
     80  global $tokens; 
    6781  if (in_array('see_my_photos', $tokens)) 
    68   include(SMP_PATH . 'pagessmp.php'); 
    69  } 
     82    include(SMP_PATH . 'pagessmp.php'); 
     83} 
    7084?> 
  • extensions/see_my_photos/pagessmp.php

    r27486 r31459  
    11<?php 
    2 load_language('plugin.lang', SMP_PATH); 
     2// +-----------------------------------------------------------------------+ 
     3// | See My Photos plugin for piwigo                                       | 
     4// +-----------------------------------------------------------------------+ 
     5// | Copyright(C) 2014 - 2016 ddtddt             http://temmii.com/piwigo/ | 
     6// +-----------------------------------------------------------------------+ 
     7// | This program is free software; you can redistribute it and/or modify  | 
     8// | it under the terms of the GNU General Public License as published by  | 
     9// | the Free Software Foundation                                          | 
     10// |                                                                       | 
     11// | This program is distributed in the hope that it will be useful, but   | 
     12// | WITHOUT ANY WARRANTY; without even the implied warranty of            | 
     13// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      | 
     14// | General Public License for more details.                              | 
     15// |                                                                       | 
     16// | You should have received a copy of the GNU General Public License     | 
     17// | along with this program; if not, write to the Free Software           | 
     18// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | 
     19// | USA.                                                                  | 
     20// +-----------------------------------------------------------------------+ 
    321 
    422global $page, $conf, $user; 
    5         $forbidden = get_sql_condition_FandF( 
    6               array( 'visible_images' => 'id' ), 
    7               'AND' 
    8           ); 
     23$forbidden = get_sql_condition_FandF( 
     24  array( 'visible_images' => 'id' ), 
     25  'AND' 
     26); 
    927$page['section'] = 'see_my_photos'; 
    1028$page['section_title'] =  '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator']. '<a href="'.get_absolute_root_url().'index.php?/see_my_photos">'.l10n('My photos').'</a>'; 
     
    2543  ).' 
    2644 AND added_by = \''.$user['id'].'\' 
    27  '.$conf['order_by'].' 
    28 ;'; 
    29  $page = array_merge 
    30  ( 
     45 '.$conf['order_by'].';'; 
     46$page = array_merge( 
    3147 $page, 
    32   array 
    33         ( 
     48  array( 
    3449  'title' => '<a href="'.duplicate_index_url(array('start'=>0)).'">'.l10n('See photos by author').'</a>', 
    3550  'items' => array_from_query($query, 'id'), 
Note: See TracChangeset for help on using the changeset viewer.