Schedule new patron drive

This commit is contained in:
Alex Cabal 2024-05-16 16:27:25 -05:00
parent 23a893f46b
commit c4bff3f613
2 changed files with 14 additions and 4 deletions

View file

@ -80,8 +80,8 @@ define('DONATION_ALERT_ON', DONATION_HOLIDAY_ALERT_ON || rand(1, 4) == 2);
// Controls the progress bar donation dialog
const DONATION_DRIVE_ON = true;
const DONATION_DRIVE_START = 'December 11, 2023 00:00:00 America/New_York';
const DONATION_DRIVE_END = 'January 7, 2024 23:59:00 America/New_York';
const DONATION_DRIVE_START = 'May 20, 2024 00:00:00 America/New_York';
const DONATION_DRIVE_END = 'June 3, 2024 23:59:00 America/New_York';
// Controls the countdown donation dialog
const DONATION_DRIVE_COUNTER_ON = false;

View file

@ -9,8 +9,18 @@ $baseTarget = 50;
$stretchCurrent = 0;
$stretchTarget = 20;
// Hide the alert if the user has closed it
if(!DONATION_DRIVE_ON || ($autoHide ?? $_COOKIE['hide-donation-alert'] ?? false) || $GLOBALS['User'] !== null || $now > $end){
// Hide the alert if...
if(
!DONATION_DRIVE_ON // The drive isn't running
||
($autoHide ?? $_COOKIE['hide-donation-alert'] ?? false) // If the user has hidden the box
||
$GLOBALS['User'] !== null // If a user is logged in
||
$start > $now // If the drive hasn't started yet
||
$now > $end // If the drive has ended
){
return;
}