mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 19:06:49 -04:00
Hide donation alerts if the ending time has passed
This commit is contained in:
parent
6b32df03ab
commit
cebf499c16
2 changed files with 11 additions and 9 deletions
|
@ -1,16 +1,17 @@
|
|||
<?
|
||||
|
||||
$start = new DateTime('May 2, 2022 00:00:00 America/New_York');
|
||||
$end = new DateTime('May 8, 2022 23:59:00 America/New_York');
|
||||
$now = new DateTime();
|
||||
|
||||
// Hide the alert if the user has closed it
|
||||
if(!DONATION_DRIVE_COUNTER_ON || ($autoHide ?? $_COOKIE['hide-donation-alert'] ?? false)){
|
||||
if(!DONATION_DRIVE_COUNTER_ON || ($autoHide ?? $_COOKIE['hide-donation-alert'] ?? false) || $now > $end){
|
||||
return;
|
||||
}
|
||||
|
||||
$autoHide = $autoHide ?? true;
|
||||
$showDonateButton = $showDonateButton ?? true;
|
||||
$current = 0;
|
||||
$start = new DateTime('May 2, 2022 00:00:00 America/New_York');
|
||||
$end = new DateTime('May 8, 2022 23:59:00 America/New_York');
|
||||
$now = new DateTime();
|
||||
|
||||
if($now < $start || $now > $end){
|
||||
return;
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<?
|
||||
|
||||
// Hide the alert if the user has closed it
|
||||
if(!DONATION_DRIVE_ON || ($autoHide ?? $_COOKIE['hide-donation-alert'] ?? false) || $GLOBALS['User'] !== null){
|
||||
return;
|
||||
}
|
||||
|
||||
$start = new DateTime('November 28, 2022 00:00:00 America/New_York');
|
||||
$end = new DateTime('December 31, 2022 23:59:00 America/New_York');
|
||||
$now = new DateTime();
|
||||
|
||||
// Hide the alert if the user has closed it
|
||||
if(!DONATION_DRIVE_ON || ($autoHide ?? $_COOKIE['hide-donation-alert'] ?? false) || $GLOBALS['User'] !== null || $now > $end){
|
||||
return;
|
||||
}
|
||||
|
||||
$autoHide = $autoHide ?? true;
|
||||
$showDonateButton = $showDonateButton ?? true;
|
||||
$current = Db::QueryInt('
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue