diff -r 53cff4b4a802 -r bde1974c263b web/wp-content/plugins/event-calendar/options.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/wp-content/plugins/event-calendar/options.php Wed Feb 03 15:37:20 2010 +0000 @@ -0,0 +1,281 @@ +myfiles=get_option('siteurl').'/wp-content/plugins/'.$mydir; + $this->schedule=$table_prefix.$this->schedule; // table name + + // wp_version < 2.0 + if(ereg('^1[.]',$wp_version)) + { + $this->wp_user_nicename='user_nickname'; + $this->wp_have_dbx=false; + } + // wp_version < 2.1 + if(ereg('^(1[.]|2[.]0)',$wp_version)) + { + $this->wp_in_category='category-'; + } + // wp_version < 2.3 + if(ereg('^(1[.]|2[.][012])',$wp_version)) + { + $this->wp_have_categories=true; + } + + $this->read_event_category(); + $this->read_show_only_events(); + $this->read_num_months(); + $this->read_day_length(); + $this->read_hide_logo(); + $this->read_hide_event_box(); + $this->read_advanced(); + $this->read_navigation(); + $this->read_disable_popups(); + $this->read_tz(); + } + + function reset_query() + { + $this->is_listing=false; + $this->is_date_range=false; + $this->is_today=false; + $this->days=false; + $this->range_from=false; + $this->range_before=false; + $this->join_ec3_sch=false; + $this->join_only_active_events=false; + $this->order_by_start=false; + } + + // READ functions + function read_event_category() + { + $this->event_category=intval( get_option('ec3_event_category') ); + } + function read_show_only_events() + { + $this->show_only_events=intval(get_option('ec3_show_only_events')); + } + function read_num_months() + { + $this->num_months =abs(intval(get_option('ec3_num_months'))); + if(!$this->num_months) + $this->num_months=1; + } + function read_day_length() + { + $this->day_length=intval(get_option('ec3_day_length')); + if($this->day_length==0) + $this->day_length=1; + } + function read_hide_logo() + { + $this->hide_logo=intval(get_option('ec3_hide_logo')); + } + function read_hide_event_box() + { + $this->hide_event_box=intval(get_option('ec3_hide_event_box')); + } + function read_advanced() + { + $this->advanced=intval(get_option('ec3_advanced')); + // Sometimes we want to play around with the value of advanced. + // 'advanced_setting' ALWAYS holds the REAL value. + $this->advanced_setting=$this->advanced; + } + function read_navigation() + { + $this->navigation=intval(get_option('ec3_navigation')); + } + function read_disable_popups() + { + $this->disable_popups=intval(get_option('ec3_disable_popups')); + } + function read_tz() + { + $this->tz = get_option('ec3_tz'); + if(empty($this->tz) || $this->tz=='wordpress') + { + // Use WordPress default (doesn't understand daylight saving time). + $gmt_offset=-intval(get_option('gmt_offset')); + $this->tz='UTC'; + if($gmt_offset>0) + $this->tz.='+'.$gmt_offset; + elseif($gmt_offset<0) + $this->tz.=$gmt_offset; + } + } + + // SET functions + function set_event_category($val) + { + if($this->event_category!=$val) + { + update_option('ec3_event_category',$val); + $this->read_event_category(); + } + } + function set_show_only_events($val) + { + if($this->show_only_events!=$val) + { + update_option('ec3_show_only_events',$val); + $this->read_show_only_events(); + } + } + function set_num_months($val) + { + if($this->num_months!=$val) + { + update_option('ec3_num_months',$val); + $this->read_num_months(); + } + } + function set_day_length($val) + { + if($this->day_length!=$val) + { + update_option('ec3_day_length',$val); + $this->read_day_length(); + } + } + function set_hide_logo($val) + { + if($this->hide_logo!=$val) + { + update_option('ec3_hide_logo',$val); + $this->read_hide_logo(); + } + } + function set_hide_event_box($val) + { + if($this->hide_event_box!=$val) + { + update_option('ec3_hide_event_box',$val); + $this->read_hide_event_box(); + } + } + function set_advanced($val) + { + if($this->advanced_setting!=$val) + { + update_option('ec3_advanced',$val); + } + // read_advanced() does some special magic, so we always call it. + $this->read_advanced(); + } + function set_navigation($val) + { + if($this->navigation!=$val) + { + update_option('ec3_navigation',$val); + $this->read_navigation(); + } + } + function set_disable_popups($val) + { + if($this->disable_popups!=$val) + { + update_option('ec3_disable_popups',$val); + $this->read_disable_popups(); + } + } + function set_tz($val) + { + if(!preg_match('/(WordPress|[_a-zA-Z\/]+)/',$val)) + return; + if($this->tz!=$val) + { + update_option('ec3_tz',$val); + $this->read_tz(); + } + } +} // end class ec3_Options + + +/** Singleton instance of ec3_Options. */ +$ec3=new ec3_Options(); + + +?>