[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/options/newsletter/processors/ -> day-1.php (source)

   1  <?php
   2  class MP_Newsletter_processor_day_1 extends MP_newsletter_processor_
   3  {
   4      public $id = 'day-1';
   5  
   6  	function get_bounds() 
   7      {
   8          $y = $this->year;
   9          $m = $this->month;
  10          $d = $this->day;
  11  
  12          $this->get_slot_context();  /* 1 slot is 24 hours is the default */
  13  
  14          if ( $this->slot_overnight )
  15          {
  16              $d--;
  17              if ( !$d )
  18              {
  19                  $m--;
  20                  if ( $m == 0 ) { $y--; $m = 12; }
  21                  $d = $this->get_last_day( $y, $m );            
  22              }
  23          }
  24          $this->upper_bound = $this->format_date( $y, $m, $d ) . ' ' . $this->slots[$this->slot];
  25  
  26          if ( $this->slots[$this->slot] <=  $this->slots[$this->slot - 1] )
  27          {
  28              $d--;
  29              if ( !$d )
  30              {
  31                  $m--;
  32                  if ( $m == 0 ) { $y--; $m = 12; }
  33                  $d = $this->get_last_day( $y, $m );            
  34              }
  35          }
  36          $this->lower_bound = $this->format_date( $y, $m, $d ) . ' ' . $this->slots[$this->slot - 1];
  37  
  38  
  39  
  40          switch ( true )
  41          {
  42              case ( isset( $this->options['threshold'] ) ) :            // old format
  43                  $y = substr( $this->options['threshold'], 0, 4 );
  44                  $m = substr( $this->options['threshold'], 4, 2 );
  45                  $j = substr( $this->options['threshold'], 6, 2 );
  46                  $this->old_lower_bound = "{$y}-{$m}-{$j} 00:00:00";
  47              break;
  48              default :
  49                  $this->get_old_lower_bound();
  50              break;
  51          }
  52      }
  53  }
  54  new MP_Newsletter_processor_day_1( __( 'Previous day', 'MailPress' ) );


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1