diff --git a/lib/Constants.php b/lib/Constants.php
index 361837bf..4456181f 100644
--- a/lib/Constants.php
+++ b/lib/Constants.php
@@ -98,6 +98,13 @@ define('PD_STRING', 'January 1, ' . (PD_YEAR + 1));
define('DONATION_HOLIDAY_ALERT_ON', time() > strtotime('November 15, ' . gmdate('Y')) || time() < strtotime('January 7, ' . gmdate('Y')));
define('DONATION_ALERT_ON', DONATION_HOLIDAY_ALERT_ON || rand(1, 4) == 2);
-define('DONATION_DRIVE_ON', false);
-define('DONATION_DRIVE_COUNTER_ON', false);
+// Controls the progress bar donation dialog
+const DONATION_DRIVE_ON = false;
+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';
+
+// Controls the countdown donation dialog
+const DONATION_DRIVE_COUNTER_ON = false;
+const DONATION_DRIVE_COUNTER_START = 'May 2, 2022 00:00:00 America/New_York';
+const DONATION_DRIVE_COUNTER_END = 'May 8, 2022 23:59:00 America/New_York';
diff --git a/templates/DonationCounter.php b/templates/DonationCounter.php
index bc325c52..9017e59b 100644
--- a/templates/DonationCounter.php
+++ b/templates/DonationCounter.php
@@ -1,7 +1,7 @@
-$start = new DateTime('May 2, 2022 00:00:00 America/New_York');
-$end = new DateTime('May 8, 2022 23:59:00 America/New_York');
+$start = new DateTime(DONATION_DRIVE_COUNTER_START);
+$end = new DateTime(DONATION_DRIVE_COUNTER_END);
$now = new DateTime();
// Hide the alert if the user has closed it
diff --git a/templates/DonationProgress.php b/templates/DonationProgress.php
index e146f874..02523ecb 100644
--- a/templates/DonationProgress.php
+++ b/templates/DonationProgress.php
@@ -1,7 +1,12 @@
-$start = new DateTime('November 28, 2022 00:00:00 America/New_York');
-$end = new DateTime('December 31, 2022 23:59:00 America/New_York');
+$start = new DateTime(DONATION_DRIVE_START);
+$end = new DateTime(DONATION_DRIVE_END);
+$totalCurrent = 0;
+$baseTarget = 30;
+$stretchCurrent = 0;
+$stretchTarget = 20;
+
$now = new DateTime();
// Hide the alert if the user has closed it
@@ -11,7 +16,7 @@ if(!DONATION_DRIVE_ON || ($autoHide ?? $_COOKIE['hide-donation-alert'] ?? false)
$autoHide = $autoHide ?? true;
$showDonateButton = $showDonateButton ?? true;
-$current = Db::QueryInt('
+$totalCurrent = Db::QueryInt('
SELECT sum(cnt)
from
(
@@ -35,11 +40,8 @@ $current = Db::QueryInt('
)
) x
', [$start, $start, $start]);
-$target = 75;
-$stretchCurrent = 0;
-$stretchTarget = 20;
-$totalCurrent = $current;
-$totalTarget = $target;
+
+$totalTarget = $baseTarget;
$deadline = $end->format('F j');
$timeLeft = $now->diff($end);
$timeString = '';
@@ -66,10 +68,10 @@ else{
}
$stretchOn = false;
-if($stretchTarget > 0 && $current >= $target){
+if($stretchTarget > 0 && $totalCurrent >= $baseTarget){
$stretchOn = true;
- $totalCurrent = $current + $stretchCurrent;
- $totalTarget = $target + $stretchTarget;
+ $stretchCurrent = $totalCurrent - $baseTarget;
+ $totalTarget = $baseTarget + $stretchTarget;
}
?>
@@ -83,14 +85,14 @@ if($stretchTarget > 0 && $current >= $target){
if(!$stretchOn){ ?>
Help us reach = number_format($target) ?> new patrons by = $deadline ?> Help us reach = number_format($baseTarget) ?> new patrons by = $deadline ?> = $timeString ?> left to help us reach = number_format($target) ?> new patrons! = $timeString ?> left to help us reach = number_format($baseTarget) ?> new patrons! Help us meet our stretch goal of = number_format($totalTarget) ?> new patrons by = $deadline ?> Help us meet our stretch goal of
= number_format($totalTarget) ?> new patrons by = $deadline ?>
0
= number_format($totalCurrent) ?>/= number_format($totalTarget) ?>
if($stretchOn){ ?> -= number_format($target) ?>
+= number_format($baseTarget) ?>
} ?>= number_format($totalTarget) ?>
When we started this drive, we set a goal of = number_format($target) ?> Patrons Circle members by = $deadline ?>. Thanks to the incredible generosity of literature lovers from all walks of life, we hit that goal in just over a week!
+When we started this drive, we set a goal of = number_format($baseTarget) ?> Patrons Circle members by = $deadline ?>. Thanks to the incredible generosity of literature lovers from all walks of life, we hit that goal in just over a week!
Since there are still weeks left in our drive, we thought we’d challenge our readers to help us reach our stretch goal of = number_format($totalTarget) ?> patrons, so that we can start the year off on a rock-solid financial footing. Will you help us with a donation, and support free and unrestricted digital literature?
}else{ ?> -It takes a huge amount of resources and highly-skilled work to create and distribute each of our free ebooks, and we need your support to keep it up. That’s why we want to welcome = number_format($target) ?> new patrons by = $deadline ?>. It’s our patrons who keep us on the stable financial footing we need to continue producing and giving away beautiful ebooks.
+It takes a huge amount of resources and highly-skilled work to create and distribute each of our free ebooks, and we need your support to keep it up. That’s why we want to welcome = number_format($baseTarget) ?> new patrons by = $deadline ?>. It’s our patrons who keep us on the stable financial footing we need to continue producing and giving away beautiful ebooks.
Will you become a patron, and support free and unrestricted digital literature?
} ?> if($showDonateButton){ ?> } ?>