From 7d69a66375de5fb08836f03e1473a9cc347b84d4 Mon Sep 17 00:00:00 2001 From: spiderr Date: Mon, 27 Nov 2023 02:28:22 -0500 Subject: use simple_set_toggle/value for admin_stats --- admin/admin_stats_inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/admin/admin_stats_inc.php b/admin/admin_stats_inc.php index 61a2dbc..21bd8ac 100644 --- a/admin/admin_stats_inc.php +++ b/admin/admin_stats_inc.php @@ -2,6 +2,7 @@ $formFeaturesBit = array( 'stats_referers' => array( 'label' => 'Referer Statistics', + 'type' => "checkbox", 'note' => 'Records statistics including HTTP_REFERRER', ), 'google_tagmanager_id' => array( @@ -23,9 +24,13 @@ $formFeaturesBit = array( $gBitSmarty->assign( 'formFeaturesBit', $formFeaturesBit ); -if( !empty( $_REQUEST['change_prefs'] ) ) { +if( !empty( $_POST['change_prefs'] ) ) { foreach ( array_keys( $formFeaturesBit ) as $feature) { - $gBitSystem->storeConfig( $feature, (isset( $_REQUEST[$feature] ) ? $_REQUEST[$feature] : NULL), STATS_PKG_NAME ); + if( $formFeaturesBit[$feature]['type'] == 'text' ) { + simple_set_value( $feature, STATS_PKG_NAME ); + } else { + simple_set_toggle( $feature, STATS_PKG_NAME ); + } } } -- cgit v1.3