source: extensions/Statistics/admin/stat_admin.php @ 3438

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

added

File size: 1.9 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4load_language('plugin.lang', STAT_PATH);
5
6
7
8$conf_statistics = explode("," , $conf['statistics']);
9
10
11
12$template->assign(
13
14  array(
15
16   'STATITICS_HEADER' => $conf_statistics[0] == 'on' ? 'checked="checked"' : '' ,
17
18   'STATISTICS_TAIL' => $conf_statistics[1] == 'on' ? 'checked="checked"' : '' ,
19
20   'STATISTICS_ADMIN' => $conf_statistics[3] == 'on' ? 'checked="checked"' : '' ,
21
22   'STATISTICS_GUEST' => $conf_statistics[4] == 'on' ? 'checked="checked"' : '' ,
23
24                 )
25
26                );     
27
28
29
30$template->assign(array('statisticsCONTENT' => $conf_statistics[2],)); 
31
32
33
34if ( isset($_POST['submit']) )
35
36{
37
38  $value_header = isset($_POST['stat_header']) ? $_POST['stat_header'] : '' ;
39
40  $value_tail = isset($_POST['stat_tail']) ? $_POST['stat_tail'] : '' ;
41
42  $value_content = isset($_POST['statistics_content']) ? $_POST['statistics_content'] : '' ;
43
44  $value_admin = isset($_POST['stat_admin']) ? $_POST['stat_admin'] : '' ;
45
46  $value_guest = isset($_POST['stat_guest']) ? $_POST['stat_guest'] : '' ;
47
48
49
50$query = '
51
52    UPDATE '.CONFIG_TABLE.'
53
54    SET value="'.$value_header. ',' .$value_tail. ',' .$value_content.',' .$value_admin. ',' .$value_guest. '"
55
56    WHERE param="statistics"
57
58    LIMIT 1';
59
60   
61
62 pwg_query($query);
63
64 
65array_push($page['infos'], l10n('statistics_save_config'));
66
67
68$template->assign(
69
70  array(
71
72   'STATITICS_HEADER' => $value_header == 'on' ? 'checked="checked"' : '' ,
73
74   'STATISTICS_TAIL' => $value_tail  == 'on' ? 'checked="checked"' : '' ,
75
76   'STATISTICS_ADMIN'=> $value_admin  == 'on' ? 'checked="checked"' : '' ,
77
78   'STATISTICS_GUEST'=> $value_guest  == 'on' ? 'checked="checked"' : '' ,
79
80     )
81
82    ); 
83
84
85
86$template->assign(array('statisticsCONTENT' => stripslashes ($value_content))); 
87
88}
89
90
91
92$template->set_filenames(array('plugin_admin_content' => realpath(STAT_PATH . 'admin/stat_admin.tpl')));
93
94$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
95?>
Note: See TracBrowser for help on using the repository browser.