From 4b7bed9a4bdf255bbfb6e63c7ae6c0a387da23f6 Mon Sep 17 00:00:00 2001 From: kdmurray Date: Fri, 31 May 2024 17:45:02 -0700 Subject: [PATCH] Added an episode counter for feed generation to determine whether or not to include show notes. --- www/rss.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/www/rss.php b/www/rss.php index a7d8c7f..ac46d8d 100644 --- a/www/rss.php +++ b/www/rss.php @@ -220,6 +220,7 @@ print " ".date(DATE_RFC1123, strtotime(date('Y-m-d')))."\n"; if ($result = mysqli_query($connection, $query)) { + $ep_count = 0; while ($row = mysqli_fetch_array($result)) { $id = fixid(stripslashes($row['id'])); $version = $row['version']; @@ -282,7 +283,12 @@ if ($result = mysqli_query($connection, $query)) { echo " ". $email_padded . " (" . htmlspecialchars(stripslashes(strip_tags($row["host"]))) .")\n"; echo " \n"; echo " https://hackerpublicradio.org/eps/hpr".$id."/index.html\n"; - echo " \n\n"; + if ( $feed === "total" && $ep_count >= 10) { + echo " \n"; + } + else { + echo " \n\n"; + } // echo " \n\n"; echo " \n\n"; echo " " .date(DATE_RFC1123, strtotime($row['date'])) . "\n"; @@ -291,6 +297,8 @@ if ($result = mysqli_query($connection, $query)) { echo " " . $url . "\n"; echo " \n"; + $ep_count ++; + } } //Display non-connection errors