Alexander Nicolaysen Sørnes <alex@thehandofagony.com>

Adapt the missing screenshots mail in the cron screenshots cleanup code to specify more clearly what action was taken.
This commit is contained in:
Chris Morgan
2007-09-14 23:48:05 -04:00
parent 607b130577
commit f9e712382d

View File

@@ -300,18 +300,29 @@ function removeScreenshotsWithMissingFiles()
$aMissingScreenshotIds = getMissingScreenshotArray(); $aMissingScreenshotIds = getMissingScreenshotArray();
if(sizeof($aMissingScreenshotIds))
{
$sPlural = (sizeof($aMissingScreenshotIds) == 1) ? "" : "s";
// build the email to admins about what we are doing // build the email to admins about what we are doing
$sMsg = "Found ".count($aMissingScreenshotIds)." screenshots with missing files.\r\n"; $sMsg = "Found ".count($aMissingScreenshotIds)." screenshot$sPlural with missing files.\r\n";
if($sPlural)
$sMsg.= "Deleting these screenshots.\r\n"; $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 // add the screenshot ids to the email so we can see which screenshots are
// going to be deleted // going to be deleted
$sMsg.="\r\n"; $sMsg.="\r\n";
$sMsg.="Screenshot IDs:\r\n"; $sMsg.="Screenshot ID$sPlural:\r\n";
foreach($aMissingScreenshotIds as $iScreenshotId) foreach($aMissingScreenshotIds as $iScreenshotId)
{ {
$sMsg.=$iScreenshotId."\r\n"; $sMsg.=$iScreenshotId."\r\n";
} }
} else
{
$sMsg = "No screenshot entries with missing files were found.\r\n";
}
$sSubject = $sEmailSubject."Missing screenshot cleanup\r\n"; $sSubject = $sEmailSubject."Missing screenshot cleanup\r\n";