function sm_update_settings() { $settings = get_option('sm_settings'); foreach ($_POST['settings'] as $key => $value) { if ($key == 'track_expiry') { $value *= 86400; } $settings->{$key} = stripcslashes($value); } if (update_option('sm_settings', $settings)) { sm_display_feedback(__('Settings have been successfully saved', 'sm')); } }
function sm_exclude_user($session_id) { global $wpdb, $user_excludes_table; $user_id = false; $sql = 'DELETE FROM ' . $user_excludes_table . ' WHERE session_id = "' . $session_id . '" '; if ($user_id = sm_get_user_by_session($session_id)) { $sql .= 'OR user_id = ' . $user_id; } $user = sm_real_name($session_id, $user_id); if ($wpdb->query($sql)) { sm_display_feedback($user . __(' has been successfully removed from the excludes list', 'sm')); } }