Changeset 31460 for extensions/see_photos_by_user/admin.php
- Timestamp:
- Mar 19, 2016, 6:33:31 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/see_photos_by_user/admin.php
r30432 r31460 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | See photos by user 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 // +-----------------------------------------------------------------------+ 3 21 if (!defined('PHPWG_ROOT_PATH')) 4 22 die('Hacking attempt!'); 5 23 global $template, $conf, $user; 6 include_once(PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php');7 load_language('plugin.lang', SPBA_PATH);8 $my_base_url = get_admin_plugin_menu_link(__FILE__);9 24 10 25 // +-----------------------------------------------------------------------+ … … 16 31 17 32 $template->assign( 18 19 20 21 22 23 24 25 26 27 33 array( 34 'SPBU1' => $conf['see_photos_by_user_nbphotos'], 35 'SPBU2' => $conf['see_photos_by_user_limit'], 36 'SPBU3' => $conf['see_photos_by_user_order'], 37 'SPBU4' => $conf['see_photos_by_user_show'], 38 'SPBU5' => $conf['see_photos_by_user_color'], 39 'SPBU6' => $conf['see_photos_by_user_show_user_home'], 40 'SPBU7' => $conf['see_photos_by_user_shape'], 41 'SPBA_PATH2'=> get_root_url() . SPBA_PATH, 42 ) 28 43 ); 29 44 30 45 $SPBU3T = array( 31 32 33 34 46 l10n('users in alphabetical order'), 47 l10n('users by reverse alphabetical order'), 48 l10n('by increasing number of photos'), 49 l10n('by decreasing number of photos'), 35 50 ); 36 51 37 52 $SPBU3 = array( 38 39 40 41 53 'username ASC', 54 'username DESC', 55 'PBU ASC', 56 'PBU DESC', 42 57 ); 43 58 … … 46 61 47 62 $PAPAB = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'Photo_add_by';")); 48 if($PAPAB['state'] == 'active') 49 { 50 $SPBU3T2 = array( 63 if($PAPAB['state'] == 'active'){ 64 $SPBU3T2 = array( 51 65 l10n('nothing'), 52 66 l10n('link Specials menu'), 53 67 l10n('bloc menu users'), 54 55 68 ); 69 $SPBU32 = array( 56 70 '-1', 57 71 '1', … … 59 73 ); 60 74 }else{ 61 75 $SPBU3T2 = array( 62 76 l10n('link Specials menu'), 63 77 l10n('bloc menu users'), 64 65 66 67 68 78 ); 79 $SPBU32 = array( 80 '1', 81 '2', 82 ); 69 83 } 70 84 … … 73 87 74 88 $SPBU4T2 = array( 75 // l10n('nothing'), 76 l10n('users cloud'), 77 l10n('cumulus users cloud'), 78 l10n('select users box'), 89 l10n('users cloud'), 90 l10n('cumulus users cloud'), 91 l10n('select users box'), 79 92 ); 80 93 81 94 $SPBU42 = array( 82 // '-1', 83 '1', 84 '2', 85 '3' 95 '1', 96 '2', 97 '3' 86 98 ); 87 99 … … 90 102 91 103 $SPBU7 = array( 92 93 94 95 96 104 'sphere', 105 'vcylinder', 106 'hcylinder', 107 'vring', 108 'hring', 97 109 ); 98 110 99 111 $SPBUT7 = array( 100 101 102 103 104 112 l10n('sphere'), 113 l10n('vertical cylinder'), 114 l10n('horizontal cylinder'), 115 l10n('vertical ring'), 116 l10n('horizontal ring'), 105 117 ); 106 118 … … 109 121 110 122 if (isset($_POST['submitspbu'])) { 111 if (is_numeric($_POST['insspbu1'])) { 112 conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']); 113 } else { 114 array_push($page['errors'], l10n('Maximal number users is incorrect !')); 115 } 116 if (is_numeric($_POST['insspbu2'])) 117 conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']); 118 else { 119 array_push($page['errors'], l10n('Minimal number photos for show users is incorrect !')); 120 } 121 conf_update_param('see_photos_by_user_order', $_POST['insspbu3']); 122 conf_update_param('see_photos_by_user_show', $_POST['insspbu4']); 123 conf_update_param('see_photos_by_user_color', $_POST['insspbu5']); 124 conf_update_param('see_photos_by_user_show_user_home', $_POST['insspbu6']); 125 conf_update_param('see_photos_by_user_shape', $_POST['insspbu7']); 126 if (!$page['errors']) { 127 array_push($page['infos'], l10n('Update Complete')); 128 } 129 130 $template->assign( 131 array( 132 'SPBU1' => stripslashes($_POST['insspbu1']), 133 'SPBU2' => stripslashes($_POST['insspbu2']), 134 'SPBU3' => stripslashes($_POST['insspbu3']), 135 'SPBU4' => stripslashes($_POST['insspbu4']), 136 'SPBU5' => stripslashes($_POST['insspbu5']), 137 'SPBU6' => stripslashes($_POST['insspbu6']), 138 'SPBU7' => stripslashes($_POST['insspbu7']), 139 ) 140 ); 123 if (is_numeric($_POST['insspbu1'])) { 124 conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']); 125 } else { 126 array_push($page['errors'], l10n('Maximal number users is incorrect !')); 127 } 128 if (is_numeric($_POST['insspbu2'])) 129 conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']); 130 else { 131 array_push($page['errors'], l10n('Minimal number photos for show users is incorrect !')); 132 } 133 conf_update_param('see_photos_by_user_order', $_POST['insspbu3']); 134 conf_update_param('see_photos_by_user_show', $_POST['insspbu4']); 135 conf_update_param('see_photos_by_user_color', $_POST['insspbu5']); 136 conf_update_param('see_photos_by_user_show_user_home', $_POST['insspbu6']); 137 conf_update_param('see_photos_by_user_shape', $_POST['insspbu7']); 138 if (!$page['errors']) { 139 array_push($page['infos'], l10n('Update Complete')); 140 } 141 $template->assign( 142 array( 143 'SPBU1' => stripslashes($_POST['insspbu1']), 144 'SPBU2' => stripslashes($_POST['insspbu2']), 145 'SPBU3' => stripslashes($_POST['insspbu3']), 146 'SPBU4' => stripslashes($_POST['insspbu4']), 147 'SPBU5' => stripslashes($_POST['insspbu5']), 148 'SPBU6' => stripslashes($_POST['insspbu6']), 149 'SPBU7' => stripslashes($_POST['insspbu7']), 150 ) 151 ); 141 152 } 142 153
Note: See TracChangeset
for help on using the changeset viewer.