[7445] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | load_language('plugin.lang', STAT_PATH); |
---|
| 5 | |
---|
| 6 | $conf_statistics = unserialize($conf['statistics']); |
---|
| 7 | |
---|
| 8 | $template->assign( |
---|
| 9 | array( |
---|
| 10 | 'statisticsCONTENT' => $conf_statistics['content'], |
---|
| 11 | 'STATITICS_HEADER' => $conf_statistics['header'] ? 'checked="checked"' : '' , |
---|
| 12 | 'STATISTICS_TAIL' => $conf_statistics['tail'] ? 'checked="checked"' : '' , |
---|
| 13 | 'STATISTICS_ADMIN' => $conf_statistics['exclude_admin'] ? 'checked="checked"' : '' , |
---|
| 14 | 'STATISTICS_GUEST' => $conf_statistics['exclude_guest'] ? 'checked="checked"' : '' , |
---|
| 15 | ) |
---|
| 16 | ); |
---|
| 17 | |
---|
| 18 | if (isset($_POST['submit'])) |
---|
| 19 | { |
---|
| 20 | $statistics_content = stripslashes($_POST['statistics_content']); |
---|
| 21 | |
---|
| 22 | $conf_statistics = array( |
---|
| 23 | 'content' => $statistics_content, |
---|
| 24 | 'header' => isset($_POST['stat_header']), |
---|
| 25 | 'tail' => isset($_POST['stat_tail']), |
---|
| 26 | 'exclude_admin' => isset($_POST['stat_admin']), |
---|
| 27 | 'exclude_guest' => isset($_POST['stat_guest']), |
---|
| 28 | ); |
---|
| 29 | |
---|
| 30 | $query = ' |
---|
| 31 | UPDATE '.CONFIG_TABLE.' |
---|
| 32 | SET value = \''.pwg_db_real_escape_string(serialize($conf_statistics)).'\' |
---|
| 33 | WHERE param = \'statistics\' |
---|
| 34 | ;'; |
---|
| 35 | pwg_query($query); |
---|
| 36 | |
---|
| 37 | array_push($page['infos'], l10n('statistics_save_config')); |
---|
| 38 | $template->assign( |
---|
| 39 | array( |
---|
| 40 | 'statisticsCONTENT' => $statistics_content, |
---|
| 41 | 'STATITICS_HEADER' => isset($_POST['stat_header']) ? 'checked="checked"' : '' , |
---|
| 42 | 'STATISTICS_TAIL' => isset($_POST['stat_tail']) ? 'checked="checked"' : '' , |
---|
| 43 | 'STATISTICS_ADMIN' => isset($_POST['stat_admin']) ? 'checked="checked"' : '' , |
---|
| 44 | 'STATISTICS_GUEST' => isset($_POST['stat_guest']) ? 'checked="checked"' : '' , |
---|
| 45 | ) |
---|
| 46 | ); |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | $template->set_filenames(array('plugin_admin_content' => realpath(STAT_PATH . 'admin/stat_admin.tpl'))); |
---|
| 50 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 51 | ?> |
---|