From f9e712382dfb195211d59e025e5dc3fbe999ec67 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 14 Sep 2007 23:48:05 -0400 Subject: [PATCH] =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adapt the missing screenshots mail in the cron screenshots cleanup code to specify more clearly what action was taken. --- cron/cleanup.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/cron/cleanup.php b/cron/cleanup.php index b16a1cc..19619a8 100644 --- a/cron/cleanup.php +++ b/cron/cleanup.php @@ -300,17 +300,28 @@ function removeScreenshotsWithMissingFiles() $aMissingScreenshotIds = getMissingScreenshotArray(); - // build the email to admins about what we are doing - $sMsg = "Found ".count($aMissingScreenshotIds)." screenshots with missing files.\r\n"; - $sMsg.= "Deleting these screenshots.\r\n"; - - // add the screenshot ids to the email so we can see which screenshots are - // going to be deleted - $sMsg.="\r\n"; - $sMsg.="Screenshot IDs:\r\n"; - foreach($aMissingScreenshotIds as $iScreenshotId) + if(sizeof($aMissingScreenshotIds)) { - $sMsg.=$iScreenshotId."\r\n"; + $sPlural = (sizeof($aMissingScreenshotIds) == 1) ? "" : "s"; + // build the email to admins about what we are doing + $sMsg = "Found ".count($aMissingScreenshotIds)." screenshot$sPlural with missing files.\r\n"; + + if($sPlural) + $sMsg.= "Deleting these screenshots.\r\n"; + else + $sMsgm.= "Deleting it.\r\n"; + + // add the screenshot ids to the email so we can see which screenshots are + // going to be deleted + $sMsg.="\r\n"; + $sMsg.="Screenshot ID$sPlural:\r\n"; + foreach($aMissingScreenshotIds as $iScreenshotId) + { + $sMsg.=$iScreenshotId."\r\n"; + } + } else + { + $sMsg = "No screenshot entries with missing files were found.\r\n"; } $sSubject = $sEmailSubject."Missing screenshot cleanup\r\n";