[27391] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | global $template, $conf, $user; |
---|
| 4 | include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); |
---|
| 5 | load_language('plugin.lang', SPBA_PATH); |
---|
| 6 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
| 7 | |
---|
| 8 | // +-----------------------------------------------------------------------+ |
---|
| 9 | // | Check Access and exit when user status is not ok | |
---|
| 10 | // +-----------------------------------------------------------------------+ |
---|
| 11 | check_status(ACCESS_ADMINISTRATOR); |
---|
| 12 | |
---|
| 13 | global $conf, $page; |
---|
| 14 | |
---|
| 15 | $template->assign( |
---|
| 16 | array( |
---|
| 17 | 'SPBU1' => $conf['see_photos_by_user_nbphotos'], |
---|
| 18 | 'SPBU2' => $conf['see_photos_by_user_limit'], |
---|
| 19 | 'SPBU3' => $conf['see_photos_by_user_order'], |
---|
| 20 | ) |
---|
| 21 | ); |
---|
| 22 | |
---|
| 23 | $SPBU3T = array( |
---|
| 24 | l10n('users in alphabetical order'), |
---|
| 25 | l10n('users by reverse alphabetical order'), |
---|
| 26 | l10n('by increasing number of photos'), |
---|
| 27 | l10n('by decreasing number of photos'), |
---|
| 28 | ); |
---|
| 29 | |
---|
| 30 | $SPBU3 = array( |
---|
| 31 | 'username ASC', |
---|
| 32 | 'username DESC', |
---|
| 33 | 'PBU ASC', |
---|
| 34 | 'PBU DSC', |
---|
| 35 | ); |
---|
| 36 | |
---|
| 37 | $template->assign('spbu', $SPBU3); |
---|
| 38 | $template->assign('spbuT', $SPBU3T); |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | if (isset($_POST['submitspbu'])) |
---|
| 42 | { |
---|
| 43 | if (is_numeric($_POST['insspbu1'])) |
---|
| 44 | {conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']);} |
---|
| 45 | else |
---|
[27422] | 46 | {array_push( $page['errors'], l10n('Maximal number users is incorrect !'));} |
---|
[27391] | 47 | if (is_numeric($_POST['insspbu2'])) |
---|
| 48 | conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']); |
---|
| 49 | else |
---|
[27422] | 50 | {array_push( $page['errors'], l10n('Minimal number photos for show users is incorrect !'));} |
---|
[27391] | 51 | conf_update_param('see_photos_by_user_order', $_POST['insspbu3']); |
---|
| 52 | |
---|
[27394] | 53 | if (!$page['errors']) |
---|
| 54 | {array_push( $page['infos'], l10n('Update Complete') );} |
---|
[27391] | 55 | |
---|
| 56 | $template->assign( |
---|
| 57 | array( |
---|
| 58 | 'SPBU1' => stripslashes($_POST['insspbu1']), |
---|
| 59 | 'SPBU2' => stripslashes($_POST['insspbu2']), |
---|
| 60 | 'SPBU3' => stripslashes($_POST['insspbu3']), |
---|
| 61 | ) |
---|
| 62 | ); |
---|
| 63 | |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
| 67 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 68 | ?> |
---|