[ Index ]

MailPress 7.2

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

title

Body

[close]

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

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


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