Skip to content

Commit

Permalink
Update teksttv.php
Browse files Browse the repository at this point in the history
  • Loading branch information
rmens committed Oct 25, 2024
1 parent 5258272 commit 4e04b0d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/teksttv.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4e04b0d

Please sign in to comment.