Changeset 2316491
- Timestamp:
- 06/02/2020 10:27:26 AM (6 years ago)
- Location:
- mailpress/trunk
- Files:
-
- 5 edited
-
mp-content/add-ons/MailPress_newsletter.php (modified) (1 diff)
-
mp-includes/class/options/newsletter/processors/month-1.php (modified) (1 diff)
-
mp-includes/class/options/newsletter/processors/week-1.php (modified) (1 diff)
-
mp-includes/class/options/newsletter/schedulers/month.php (modified) (2 diffs)
-
mp-includes/class/options/newsletter/schedulers/week.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mailpress/trunk/mp-content/add-ons/MailPress_newsletter.php
r2315845 r2316491 381 381 wp_schedule_single_event( $now4cron - 1, 'mp_schedule_newsletters', array( 'args' => array( 'event' => '** Install **' ) ) ); 382 382 383 $twicedaily = gmmktime( 0, 0, 50, gmdate( 'n', $now4cron ), gmdate( 'j', $now4cron ), gmdate( 'Y', $now4cron ) ) - get_option( 'gmt_offset' ) * 3600;383 $twicedaily = gmmktime( 0, 0, 0, gmdate( 'n', $now4cron ), gmdate( 'j', $now4cron ), gmdate( 'Y', $now4cron ) ) - get_option( 'gmt_offset' ) * 3600; 384 384 wp_schedule_event( $twicedaily, 'twicedaily', 'mp_schedule_newsletters', array( 'args' => array( 'event' => '** Twice daily **' ) ) ); 385 385 } -
mailpress/trunk/mp-includes/class/options/newsletter/processors/month-1.php
r2273504 r2316491 8 8 $y = $this->year; 9 9 $m = $this->month; 10 $d = $this-> day;10 $d = $this->get_day( $y, $m ); 11 11 12 12 $h = $this->get_hour(); 13 13 $i = $this->get_minute(); 14 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 } 15 if ( $this->day < $d ) $m--; 16 if ( !$m ) {$m = 12; $y--;} 17 $d = $this->get_day( $y, $m ); 23 18 24 19 $this->upper_bound = $this->format_timestamp( $y, $m, $d, $h, $i, 0 ); -
mailpress/trunk/mp-includes/class/options/newsletter/processors/week-1.php
r2273504 r2316491 19 19 { 20 20 $time -= WEEK_IN_SECONDS; 21 $this->upper_bound = date( $format, $time );21 $this->upper_bound = wp_date( $format, $time ); 22 22 } 23 23 -
mailpress/trunk/mp-includes/class/options/newsletter/schedulers/month.php
r2273504 r2316491 10 10 $y = $this->year; 11 11 $m = $this->month; 12 $d = $this-> day;12 $d = $this->get_day( $y, $m ); 13 13 14 14 $h = $this->get_hour(); 15 15 $i = $this->get_minute(); 16 16 17 $first_day = $this->get_day( $y, $m ); 18 19 if ( $d > $first_day ) 17 if ( $this->day > $d ) 20 18 { 21 19 $m++; … … 26 24 $timestamp = $this->format_timestamp( $y, $m, $d, $h, $i, 0 ); 27 25 28 if ( $timestamp < $this->date )29 {30 $m++;31 if ( $m > 12 ) { $m = 1; $y++; }32 $d = $this->get_day( $y, $m );33 34 $timestamp = $this->format_timestamp( $y, $m, $d, $h, $i, 0 );35 }36 37 26 return $this->schedule_single_event( $timestamp ); 38 27 } -
mailpress/trunk/mp-includes/class/options/newsletter/schedulers/week.php
r2273504 r2316491 12 12 $format = 'Y-m-d ' . zeroise( $this->get_hour(), 2 ) . ':' . zeroise( $this->get_minute(), 2 ) . ':00'; 13 13 14 $ first_wday = $this->get_wday();15 16 while ( wp_date( 'w', $time ) != $first_wday ) $time += DAY_IN_SECONDS;14 $wdiff = $this->get_wday() - $this->wday; 15 if ( $wdiff < 0 ) $wdiff += 7; 16 $time += $wdiff * DAY_IN_SECONDS; 17 17 18 18 $timestamp = wp_date( $format, $time ); 19 20 if ( $timestamp < $this->date )21 {22 $time += WEEK_IN_SECONDS;23 $timestamp = wp_date( $format, $time );24 }25 19 26 20 return $this->schedule_single_event( $timestamp );
Note: See TracChangeset
for help on using the changeset viewer.