Changeset 31459 for extensions/see_my_photos/main.inc.php
- Timestamp:
- Mar 19, 2016, 5:42:50 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/see_my_photos/main.inc.php
r27486 r31459 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=722 7 7 Author: ddtddt 8 Author URI: 8 Author URI: http://temmii.com/piwigo/ 9 9 */ 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 // +-----------------------------------------------------------------------+ 10 29 11 30 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); … … 18 37 add_event_handler('loc_end_section_init', 'section_init_SMP'); 19 38 39 add_event_handler('loading_lang', 'see_my_photos_loading_lang'); 40 function see_my_photos_loading_lang(){ 41 load_language('plugin.lang', SMP_PATH); 42 } 20 43 21 function add_link_SMP($menu_ref_arr) 22 44 45 function add_link_SMP($menu_ref_arr){ 23 46 global $conf, $user; 24 25 $query = ' 47 $query = ' 26 48 SELECT DISTINCT(id) 27 49 FROM '.IMAGES_TABLE.' … … 37 59 'WHERE' 38 60 ).' 39 AND added_by = \''.$user['id'].'\' 40 ;'; 61 AND added_by = \''.$user['id'].'\';'; 41 62 $result = pwg_query($query); 42 63 $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( 54 71 'URL' => make_index_url(array('section' => 'see_my_photos')), 55 72 'TITLE' => l10n('My photos'), 56 73 'NAME' => l10n('My photos').' ('.$nbp.')', 57 ) 58 ) 59 ); 60 } 61 } 74 ))); 75 } 76 } 62 77 } 63 78 64 function section_init_SMP() 65 { 66 global $tokens; 79 function section_init_SMP(){ 80 global $tokens; 67 81 if (in_array('see_my_photos', $tokens)) 68 include(SMP_PATH . 'pagessmp.php');69 82 include(SMP_PATH . 'pagessmp.php'); 83 } 70 84 ?>
Note: See TracChangeset
for help on using the changeset viewer.