source: extensions/Image_For_All/admin/img_admin.php @ 3437

Last change on this file since 3437 was 3437, checked in by sakkhho, 15 years ago

update

File size: 1.5 KB
Line 
1<?php
2
3
4
5if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
6
7load_language('plugin.lang', IMG_PATH);
8
9include_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
31if (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
45if (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
61if (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
75if (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
99array_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?>
Note: See TracBrowser for help on using the repository browser.