1 | <?php |
---|
2 | |
---|
3 | |
---|
4 | |
---|
5 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
6 | |
---|
7 | load_language('plugin.lang', IMG_PATH); |
---|
8 | |
---|
9 | include_once(PHPWG_ROOT_PATH.'include/functions_user.inc.php'); |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | $conf_imageforall= explode("," , $conf['imageforall']); |
---|
14 | |
---|
15 | $template->assign(array('CURRENT' => $conf_imageforall[0],)); |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | $query = 'SELECT COUNT(DISTINCT(image_id)) FROM '.IMAGE_CATEGORY_TABLE.';'; |
---|
22 | |
---|
23 | $result = pwg_query($query) ; |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | $total_img = mysql_fetch_row($result); |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | if (isset($_POST['insert_nb_tot'])){ |
---|
32 | |
---|
33 | $template->assign( |
---|
34 | |
---|
35 | array( |
---|
36 | |
---|
37 | 'NEW_EXPRESS' => $_POST['new_form'].'{NB_TOTAL}', |
---|
38 | |
---|
39 | )); |
---|
40 | |
---|
41 | } |
---|
42 | |
---|
43 | |
---|
44 | |
---|
45 | if (isset($_POST['insert_nb_access'])){ |
---|
46 | |
---|
47 | $template->assign( |
---|
48 | |
---|
49 | array( |
---|
50 | |
---|
51 | 'NEW_EXPRESS' => $_POST['new_form'].'{NB_PICTURE}', |
---|
52 | |
---|
53 | )); |
---|
54 | |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | if (isset($_POST['insert_default'])){ |
---|
62 | |
---|
63 | $template->assign( |
---|
64 | |
---|
65 | array( |
---|
66 | |
---|
67 | 'NEW_EXPRESS' => '{NB_PICTURE} images / {NB_TOTAL} images', |
---|
68 | |
---|
69 | )); |
---|
70 | |
---|
71 | } |
---|
72 | |
---|
73 | |
---|
74 | |
---|
75 | if (isset($_POST['submit']) and !empty($_POST['new_form']) and !is_adviser()) |
---|
76 | |
---|
77 | { |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | $query = ' |
---|
82 | |
---|
83 | UPDATE '.CONFIG_TABLE.' |
---|
84 | |
---|
85 | SET value="'.$_POST['new_form'].'" |
---|
86 | |
---|
87 | WHERE param="imageforall" |
---|
88 | |
---|
89 | LIMIT 1'; |
---|
90 | |
---|
91 | pwg_query($query); |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | $template->assign(array('CURRENT' => $_POST['new_form'],)); |
---|
96 | |
---|
97 | |
---|
98 | |
---|
99 | array_push( |
---|
100 | |
---|
101 | $page['infos'], |
---|
102 | |
---|
103 | sprintf(l10n('new_express_saved')) |
---|
104 | |
---|
105 | ); |
---|
106 | |
---|
107 | } |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | $template->set_filenames(array('plugin_admin_content' => realpath(IMG_PATH . 'admin/img_admin.tpl'))); |
---|
112 | |
---|
113 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
114 | |
---|
115 | |
---|
116 | |
---|
117 | ?> |
---|