send out only on business days

This commit is contained in:
Alexander Yakovlev 2017-05-04 16:19:35 +07:00
parent 96ed7021db
commit a580f459e6

View file

@ -9,6 +9,10 @@ function getLatestActiveThreads()
// This will be the array, where we can save the threads
$threads = array();
$limit = strtotime("1 day ago");
if (date("D") === "Mon") {
$limit = strtotime("3 days ago");
}
// Run the Query
$query = "SELECT `".MYBB_PREFIX."forums`.`name` AS `forumname`,
`".MYBB_PREFIX."threads`.`subject`,
@ -26,7 +30,7 @@ function getLatestActiveThreads()
";
$query = $pdo->prepare($query);
$query->execute([
'date' => strtotime("1 day ago")
'date' => $limit
]);
return $query->fetchAll();