From 30ad48a2f360d2acd0605c73b55a3bab9047908a Mon Sep 17 00:00:00 2001
From: campi
Date: Mon, 5 Dec 2022 18:44:49 +0100
Subject: [PATCH] modified broadcast page
---
page-broadcast.php | 87 +++++++++++++++++++++++++++-------------------
1 file changed, 52 insertions(+), 35 deletions(-)
diff --git a/page-broadcast.php b/page-broadcast.php
index ac315ac..e26490f 100755
--- a/page-broadcast.php
+++ b/page-broadcast.php
@@ -5,7 +5,42 @@
*/
?>
---> Trasmissione conclusa <---
';
+ } else {
+ $x = 0;
+ do {
+ $start_time = get_post_meta(get_the_ID(), 'on_air_start_'.$x, true);
+ $cadence = get_post_meta(get_the_ID(), 'on_air_cadence_'.$x, true);
+ $litteral_day = $week[((int)$day) - 1];
+ switch((int) $cadence) {
+ case 2: //ogni 2 settimane
+ case 3: //ogni 3 settimane
+ case 4: //ogni 4 settimane
+ $text = "$cadence $litteral_day";
+ break;
+ case 5: //una volta al mese
+ $start_date = get_post_meta(get_the_ID(), 'on_air_start_date_'.$x, true);
+ $day_of_the_month = which_day_of_the_month(new DateTime($start_date));
+ $text = "{$day_of_the_month}a $litteral_day del mese";
+ break;
+ default: //settimanale e altro non gestito (errori, etc.)
+ $text = "$litteral_day";
+ break;
+ }
+ $content .= '---> In diretta ogni '.$text.' dalle ore '.$start_time.' <---
';
+ $x = $x + 1;
+ $day = get_post_meta(get_the_ID(), 'on_air_day_'.$x, true);
+ } while (!empty($day));
+ }
+ return $content;
+}
+
get_header();?>
@@ -13,10 +48,10 @@ get_header();?>
Ultime puntate e notizie
-';
- print_r($cat_id);
-
- echo '';
- */
$last_posts = get_posts(
array(
'numberposts' => 3,
'category' => $cat_id
)
);
- //echo '
';
- //print_r($last_posts);
- //echo '
';
foreach ($last_posts as $s_post) {
$american_data = explode(" ", $s_post->post_date);
$data_a = explode("-", $american_data[0]); ?>