From 4e04b0dcb479503811518a045ba8bf260ef1a6ca Mon Sep 17 00:00:00 2001 From: rmens Date: Fri, 25 Oct 2024 20:08:36 +0200 Subject: [PATCH] Update teksttv.php --- lib/teksttv.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/teksttv.php b/lib/teksttv.php index b1637d9..79701c9 100644 --- a/lib/teksttv.php +++ b/lib/teksttv.php @@ -189,7 +189,7 @@ private function get_primary_category_image($post_id) } } - // Fallback to post thumbnail if no primary category image + // Fall back to post thumbnail if no primary category image return get_the_post_thumbnail_url($post_id, 'large'); } @@ -220,7 +220,7 @@ private function get_image_slide($block) $today = date('N'); // 1 (Monday) to 7 (Sunday) $allowed_days = $block['dagen']; // Array of strings ["1", "2", ..., "7"] - if (!in_array((string) $today, $allowed_days, true)) { + if (!in_array((string)$today, $allowed_days, true)) { // Today is not in the allowed days return null; } @@ -248,12 +248,8 @@ private function get_ad_campaigns() $current_timestamp = current_time('timestamp'); foreach ($all_campaigns as $campaign) { // Get start and end timestamps for the campaign - $start_timestamp = !empty($campaign['campagne_datum_in']) - ? strtotime($campaign['campagne_datum_in'] . ' 00:00:00') - : 0; - $end_timestamp = !empty($campaign['campagne_datum_uit']) - ? strtotime($campaign['campagne_datum_uit'] . ' 23:59:59') - : PHP_INT_MAX; + $start_timestamp = !empty($campaign['campagne_datum_in']) ? strtotime($campaign['campagne_datum_in'] . ' 00:00:00') : 0; + $end_timestamp = !empty($campaign['campagne_datum_uit']) ? strtotime($campaign['campagne_datum_uit'] . ' 23:59:59') : PHP_INT_MAX; // Check if the campaign is active if ($current_timestamp >= $start_timestamp && $current_timestamp <= $end_timestamp) {