source: extensions/see_photos_by_user/admin.php @ 27484

Last change on this file since 27484 was 27459, checked in by ddtddt, 10 years ago

[extensions] - see_photos_by_user - news option show / Photo add by

File size: 2.6 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3global $template, $conf, $user;
4include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
5load_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// +-----------------------------------------------------------------------+
11check_status(ACCESS_ADMINISTRATOR);
12
13global $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        'SPBU4' => $conf['see_photos_by_user_show'],
21    )
22  );
23 
24$SPBU3T = array(
25    l10n('users in alphabetical order'),
26    l10n('users by reverse alphabetical order'),
27    l10n('by increasing number of photos'),
28        l10n('by decreasing number of photos'),
29  );
30 
31$SPBU3 = array(
32    'username ASC',
33    'username DESC',
34    'PBU ASC',
35        'PBU DSC',
36  );
37
38$template->assign('spbu', $SPBU3);
39$template->assign('spbuT', $SPBU3T); 
40
41$SPBU3T2 = array(
42    l10n('link Specials menu')." - ".l10n('select users box'),
43    l10n('bloc menu users')." - ".l10n('select users box'),
44    l10n('link Specials menu')." - ".l10n('select users box')." - ".l10n('bloc menu users'),
45        l10n('bloc menu users'),
46        l10n('select users box'),
47        l10n('nothing'),
48  );
49 
50$SPBU32 = array(
51    '1',
52    '2',
53    '3',
54        '4',
55        '5',
56        '6',
57  );
58
59$template->assign('spbu2', $SPBU32);
60$template->assign('spbuT2', $SPBU3T2); 
61
62if (isset($_POST['submitspbu']))
63{
64if (is_numeric($_POST['insspbu1'])) 
65{conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']);}
66else
67{array_push( $page['errors'], l10n('Maximal number users is incorrect !'));}
68if (is_numeric($_POST['insspbu2'])) 
69conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']);
70else
71{array_push( $page['errors'], l10n('Minimal number photos for show users is incorrect !'));}
72conf_update_param('see_photos_by_user_order', $_POST['insspbu3']);
73conf_update_param('see_photos_by_user_show', $_POST['insspbu4']);
74
75if (!$page['errors'])
76{array_push( $page['infos'], l10n('Update Complete') );}
77 
78$template->assign(
79    array(
80      'SPBU1' => stripslashes($_POST['insspbu1']),
81          'SPBU2' => stripslashes($_POST['insspbu2']),
82          'SPBU3' => stripslashes($_POST['insspbu3']),
83          'SPBU4' => stripslashes($_POST['insspbu4']),
84      )
85    );
86
87}
88
89$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
90$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
91?>
Note: See TracBrowser for help on using the repository browser.