diff --git a/public_html/classes/campaign.php b/public_html/classes/campaign.php
index a235fb7..964685a 100644
--- a/public_html/classes/campaign.php
+++ b/public_html/classes/campaign.php
@@ -143,7 +143,7 @@ class Campaign extends CPHPDatabaseRecordClass
if(!empty($cphp_config->debugmode) || $this->sLastStatisticsUpdate < time() - (60 * 5))
{
/* Update subscriber count */
- if($result = $database->CachedQuery("SELECT COUNT(*) FROM subscriptions WHERE `CampaignId` = :CampaignId AND `Confirmed` = 1", array(":CampaignId" => $this->sId)))
+ if($result = $database->CachedQuery("SELECT COUNT(*) FROM subscriptions WHERE `CampaignId` = :CampaignId AND `Confirmed` = 1 AND `Active` = 1", array(":CampaignId" => $this->sId)))
{
$this->uSubscriberCount = $result->data[0]["COUNT(*)"];
}
@@ -151,7 +151,7 @@ class Campaign extends CPHPDatabaseRecordClass
/* Update total monthly donations */
try
{
- $sSubscriptions = Subscription::CreateFromQuery("SELECT * FROM subscriptions WHERE `CampaignId` = :CampaignId AND `Confirmed` = 1", array(":CampaignId" => $this->sId));
+ $sSubscriptions = Subscription::CreateFromQuery("SELECT * FROM subscriptions WHERE `CampaignId` = :CampaignId AND `Confirmed` = 1 AND `Active` = 1", array(":CampaignId" => $this->sId));
$sTotalDonations = 0;
foreach($sSubscriptions as $sSubscription)
diff --git a/public_html/cron.daily.php b/public_html/cron.daily.php
index 05dae44..1b8d626 100644
--- a/public_html/cron.daily.php
+++ b/public_html/cron.daily.php
@@ -34,7 +34,7 @@ Currency::UpdateRates();
try
{
- $sSubscriptions = Subscription::CreateFromQuery("SELECT * FROM subscriptions WHERE `Confirmed` = 1 AND `LastEmail` IS NULL OR `LastEmail` < DATE_SUB(NOW(), INTERVAL 1 MONTH)");
+ $sSubscriptions = Subscription::CreateFromQuery("SELECT * FROM subscriptions WHERE `Confirmed` = 1 AND `Active` = 1 AND `LastEmail` IS NULL OR `LastEmail` < DATE_SUB(NOW(), INTERVAL 1 MONTH)");
}
catch (NotFoundException $e)
{
diff --git a/public_html/modules/subscribe.php b/public_html/modules/subscribe.php
index f81bc73..9813730 100644
--- a/public_html/modules/subscribe.php
+++ b/public_html/modules/subscribe.php
@@ -85,7 +85,8 @@ $sSubscription->uSettingsKey = random_string(25);
$sSubscription->uCurrency = $_POST['currency'];
$sSubscription->uAmount = str_replace(",", ".", $_POST['amount']);
$sSubscription->uSubscriptionDate = time();
-$sSubscription->uConfirmed = False;
+$sSubscription->uIsConfirmed = false;
+$sSubscription->uIsActive = false;
$sSubscription->uCampaignId = $sCampaign->sId;
$sSubscription->InsertIntoDatabase();