apsw_db_helper = $apsw_db_helper; $this->apsw_options_serialized = new APSW_Options_Serialize(); } public function get_default_options() { return $this->apsw_options_serialized; } /** * Builds options page */ public function options_form() { $all_post_types = $this->apsw_db_helper->get_published_post_types(); foreach ($all_post_types as $post_type) { $this->post_types[] = $post_type['post_type']; if ($post_type['taxonomies']) { foreach ($post_type['taxonomies'] as $taxonomies) { $this->custom_taxonomy_types[] = $taxonomies['taxonomy']; } } } if (!$this->apsw_options_serialized->post_types) { $this->apsw_options_serialized->post_types = $this->post_types; } if (isset($_POST['submit'])) { if (function_exists('current_user_can') && !current_user_can('manage_options')) { die(_e('Hacker?', APSW_Core::$text_domain)); } if (function_exists('check_admin_referer')) { check_admin_referer('stats_options_form'); } $this->apsw_options_serialized->is_stats_together = isset($_POST['is_stats_together']) ? $_POST['is_stats_together'] : 1; $this->apsw_options_serialized->is_stats_on_all_pages = isset($_POST['is_stats_on_all_pages']) ? $_POST['is_stats_on_all_pages'] : 0; $this->apsw_options_serialized->post_types = isset($_POST['post_types']) ? $_POST['post_types'] : $this->post_types; $this->apsw_options_serialized->custom_taxonomy_types = isset($_POST['custom_taxonomy_types']) ? $_POST['custom_taxonomy_types'] : array(); $this->apsw_options_serialized->is_display_author_name = isset($_POST['is_display_author_name']) ? $_POST['is_display_author_name'] : 0; $this->apsw_options_serialized->is_display_author_avatar = isset($_POST['is_display_author_avatar']) ? $_POST['is_display_author_avatar'] : 0; $this->apsw_options_serialized->is_author_popular_by_post_count = isset($_POST['is_author_popular_by_post_count']) ? $_POST['is_author_popular_by_post_count'] : '1'; $this->apsw_options_serialized->is_popular_posts_by_post_views = isset($_POST['is_popular_posts_by_post_views']) ? $_POST['is_popular_posts_by_post_views'] : '1'; $this->apsw_options_serialized->popular_authors_limit = (isset($_POST['popular_authors_limit']) && intval($_POST['popular_authors_limit']) && intval($_POST['popular_authors_limit']) > 0) ? intval($_POST['popular_authors_limit']) : '10'; $this->apsw_options_serialized->is_post_view_by_ip = isset($_POST['is_post_view_by_ip']) ? $_POST['is_post_view_by_ip'] : '1'; $this->apsw_options_serialized->is_display_daily_views = isset($_POST['is_display_daily_views']) ? $_POST['is_display_daily_views'] : '0'; $this->apsw_options_serialized->popular_posts_limit = (isset($_POST['popular_posts_limit']) && intval($_POST['popular_posts_limit']) && intval($_POST['popular_posts_limit']) > 0) ? intval($_POST['popular_posts_limit']) : '10'; $this->apsw_options_serialized->custom_css = isset($_POST['custom_css']) ? $_POST['custom_css'] : ''; $this->apsw_options_serialized->update_options(); } ?>


apsw_options_serialized->apsw_options_page_slug); $this->apsw_options_serialized->post_types = array('post', 'page'); $this->apsw_options_serialized->custom_taxonomy_types = array(); $this->apsw_options_serialized->add_options(); $this->apsw_options_serialized->init_options(get_option($this->apsw_options_serialized->apsw_options_page_slug)); } ?>