From 97797e5592e1c48d1b625bfe75a0a73718d821e5 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 26 Feb 2013 04:55:18 +0100 Subject: [PATCH] Only count confirmed subscriptions for statistics --- public_html/classes/campaign.php | 2 +- public_html/classes/logentry.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public_html/classes/campaign.php b/public_html/classes/campaign.php index fd94ea2..9dd9848 100644 --- a/public_html/classes/campaign.php +++ b/public_html/classes/campaign.php @@ -168,7 +168,7 @@ class Campaign extends CPHPDatabaseRecordClass /* Update past-month subscription count */ if($result = $database->CachedQuery("SELECT COUNT(*) FROM log_entries WHERE `CampaignId` = :CampaignId AND `Type` = :Type AND `Date` > DATE_SUB(NOW(), INTERVAL 1 MONTH)", - array(":CampaignId" => $this->sId, ":Type" => LogEntry::SUBSCRIPTION))) + array(":CampaignId" => $this->sId, ":Type" => LogEntry::SUBSCRIPTION_CONFIRMED))) { $this->uPastMonthSubscriptions = $result->data[0]["COUNT(*)"]; } diff --git a/public_html/classes/logentry.php b/public_html/classes/logentry.php index b31dc57..9c31b15 100644 --- a/public_html/classes/logentry.php +++ b/public_html/classes/logentry.php @@ -42,4 +42,5 @@ class LogEntry extends CPHPDatabaseRecordClass const DONATION_ASKED = 3; const DONATION_MADE = 4; const UNSUBSCRIPTION = 5; + const SUBSCRIPTION_CONFIRMED = 6; }