Changeset 7445 for extensions/Statistics/admin/stat_admin.php
- Timestamp:
- Oct 28, 2010, 12:19:44 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Statistics/admin/stat_admin.php
r3438 r7445 4 4 load_language('plugin.lang', STAT_PATH); 5 5 6 7 8 $conf_statistics = explode("," , $conf['statistics']); 9 10 6 $conf_statistics = unserialize($conf['statistics']); 11 7 12 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 ); 13 17 14 array( 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 ); 15 29 16 'STATITICS_HEADER' => $conf_statistics[0] == 'on' ? 'checked="checked"' : '' , 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); 17 36 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 34 if ( 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 65 array_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 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 ); 88 47 } 89 48 90 91 92 49 $template->set_filenames(array('plugin_admin_content' => realpath(STAT_PATH . 'admin/stat_admin.tpl'))); 93 94 50 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 95 51 ?>
Note: See TracChangeset
for help on using the changeset viewer.