function EzAdSense()
 {
     parent::__construct("easy-adsense", "Easy Plugin for AdSense", __FILE__);
     $this->prefix = 'ezAdSense';
     $this->adminMsg = '';
     $this->defaults = array('defaultText' => 'Please generate and paste your ad code here. If left empty, the ad location will be highlighted on your blog pages with a reminder to enter your code.');
     $defaultOptions = $this->mkDefaultOptions();
     $this->optionName = $this->prefix . get_option('stylesheet');
     $this->options = get_option($this->optionName);
     if (empty($this->options)) {
         $this->options = $defaultOptions;
     } else {
         $this->options = array_merge($defaultOptions, $this->options);
     }
     // Counts and limis
     $this->ezMax = $this->options['max_count'];
     $this->urMax = $this->options['max_link'];
     $this->urCount = 0;
     $this->ezCount = 0;
     $this->metaOptions = array();
     $this->border = '';
     $stats =& $this->stats;
     $stats = get_option('easy_adsense_stats_new', (object) array('start_date' => null, 'duration' => 5, 'display_admin_notice' => true, 'admin_has_disabled' => false, 'expired' => null, 'collecting' => null));
     if (empty($stats->start_date)) {
         // Set today's date on first run
         $stats->start_date = date('Y-m-d');
         update_option('easy_adsense_stats_new', $stats);
     }
     $today = date('Y-m-d');
     $day_passed = strtotime($today) - strtotime($stats->start_date);
     $stats->expired = $day_passed > $this->stats->duration;
     $stats->collecting = !$stats->expired && !$stats->admin_has_disabled;
 }
Esempio n. 2
0
 function EzAdSense()
 {
     parent::__construct("easy-adsense", "Easy Plugin for AdSense", __FILE__);
     $this->prefix = 'ezAdSense';
     $this->adminMsg = '';
     $this->defaults = array('defaultText' => 'Please generate and paste your ad code here. If left empty, the ad location will be highlighted on your blog pages with a reminder to enter your code.');
     $defaultOptions = $this->mkDefaultOptions();
     $this->optionName = $this->prefix . get_option('stylesheet');
     $this->options = get_option($this->optionName);
     if (empty($this->options)) {
         $this->options = $defaultOptions;
     } else {
         $this->options = array_merge($defaultOptions, $this->options);
     }
     // Counts and limis
     $this->ezMax = $this->options['max_count'];
     $this->urMax = $this->options['max_link'];
     $this->urCount = 0;
     $this->ezCount = 0;
     $this->metaOptions = array();
     $this->border = '';
 }