setdefault(); //not setting propaty load $this->SettingValueRead(); } function add_option_page() { add_options_page('XPressME', __('XPressME Settings', 'xpressme'), 8, 'xpressme_config', array(&$this, 'option_page')); } function add_admin_head() { // add header text } //Set Default Value function setDefault() { $this->is_use_xoops_upload_path = true; $this->is_theme_sidebar_disp = true; $this->is_save_post_revision = true; $this->is_postnavi_title_disp = true; $this->is_left_postnavi_old = true; $this->old_post_link_text = __('to Old Post'); $this->newer_post_link_text = __('to Newer Post'); $this->is_author_view_count = false; } function SettingValueRead() { $options = get_option('xpressme_option'); if (!$options) { $this->setDefault(); $this->SettingValueWrite('add_new'); } else { foreach ($options as $option_name => $option_value){ $this-> {$option_name} = $option_value; } } } // mode 0:add 1:update function SettingValueWrite($mode) { $write_options = array ( 'is_use_xoops_upload_path' => $this->is_use_xoops_upload_path , 'is_theme_sidebar_disp' => $this->is_theme_sidebar_disp , 'is_save_post_revision' => $this->is_save_post_revision , 'is_postnavi_title_disp' => $this->is_postnavi_title_disp , 'is_left_postnavi_old' => $this->is_left_postnavi_old , 'old_post_link_text' => $this->old_post_link_text , 'newer_post_link_text' => $this->newer_post_link_text, 'is_author_view_count' => $this->is_author_view_count ); if ($mode == 'add_new') { add_option('xpressme_option', $write_options); } else { update_option("xpressme_option", $write_options); } } function ReadPostData() { $this->is_use_xoops_upload_path = stripslashes(trim($_POST['ch_is_use_xoops_upload_path'])); $this->is_theme_sidebar_disp = stripslashes(trim($_POST['ch_is_theme_sidebar_disp'])); $this->is_save_post_revision = stripslashes(trim($_POST['ch_is_save_post_revision'])); $this->is_postnavi_title_disp = stripslashes(trim($_POST['ch_is_postnavi_title_disp'])); $this->is_left_postnavi_old = stripslashes(trim($_POST['ch_is_left_postnavi_old'])); $this->old_post_link_text = stripslashes($_POST['ch_old_post_link_text']); if(empty($this->old_post_link_text)) $this->old_post_link_text = __('to Old Post'); $this->newer_post_link_text = stripslashes($_POST['ch_newer_post_link_text']); if(empty($this->newer_post_link_text)) $this->newer_post_link_text = __('to Newer Post'); $this->is_author_view_count = stripslashes(trim($_POST['ch_is_author_view_count'])); } function yes_no_radio_option($option_name,$option_desc,$yes = '',$no= ''){ if (empty( $yes )) $yes = __('YES','xpressme') ; if (empty( $no )) $no = __('NO','xpressme') ; $value = $this->{$option_name}; $ans_name = 'ch_' . $option_name; $form = "