Merge pull request 'Fix future feed by removing gomax and adding future switch' (#55) from I54_Future_feed_not_working_after_switching_to_ccdn into main

Reviewed-on: #55
This commit is contained in:
Ken Fallon 2024-10-23 08:37:41 +00:00
commit 1615626c42

View File

@ -35,6 +35,11 @@ switch ($atomurl) {
$mimetype = "audio/mpeg";
$feed = "total";
break;
case "/rss-future.php":
$format = "mp3";
$mimetype = "audio/mpeg";
$feed = "future";
break;
case "/hpr_ogg_rss.php":
$format = "ogg";
$mimetype = "audio/ogg";
@ -116,14 +121,10 @@ if (isset($_GET['full'])) {
}
}
$gomax = "0";
if (isset($_GET['gomax'])) {
$gomax = $_GET['gomax'];
if ( $gomax === "1" ) {
$gomax = "1";
}
if ( $feed === "future" ) {
$query = "${query}\nAND eps.date >= UTC_DATE() ";
}
if ( $gomax === "0" ) {
else {
$query = "${query}\nAND eps.date <= UTC_DATE() ";
}
@ -184,7 +185,6 @@ print '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";
<itunes:keywords>Community Radio, Tech Interviews, Linux, Open, Hobby, Software Freedom</itunes:keywords>
<copyright>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License</copyright>
<managingEditor>feedback@NOSPAM-hackerpublicradio.org (HPR Feedback)</managingEditor>
<!-- <author>feedback@NOSPAM-hackerpublicradio.org (HPR Feedback)</author> -->
<itunes:owner>
<itunes:name>HPR Volunteer</itunes:name>
<itunes:email>admin@hackerpublicradio.org</itunes:email>
@ -237,16 +237,13 @@ if ($result = mysqli_query($connection, $query)) {
$itunes_summary = htmlspecialchars(stripslashes(strip_tags(substr($row["notes"],0,4000))));
if ( $html == 1 ) {
# $show_notes = "<p>This show has been flagged as $episode_explicit by the host.</p>\n" . $row["notes"];
$show_notes = $row["notes"];
$warning = "<p>This show has been flagged as $episode_explicit by the host.</p>\n";
}
else {
# $show_notes = "This show has been flagged as $episode_explicit by the host.\n" . htmlspecialchars(stripslashes(strip_tags($row["notes"]))) ;
$show_notes = htmlspecialchars(stripslashes(strip_tags($row["notes"]))) ;
$warning = "This show has been flagged as $episode_explicit by the host.\n";
}
# $show_notes = utf8_encode ( $show_notes );
$warning = utf8_encode ( $warning );
echo " <item>\n";
if ( $episode_explicit === "Clean" ) {
@ -272,7 +269,6 @@ if ($result = mysqli_query($connection, $query)) {
else {
echo " <description><![CDATA[" . $show_notes . "]]>\n</description>\n";
}
// echo " <googleplay:description><![CDATA[" . $show_notes . "]]>\n</googleplay:description>\n";
echo " <itunes:summary><![CDATA[" . $itunes_summary . "]]>\n</itunes:summary>\n";
echo " <pubDate>" .date(DATE_RFC1123, strtotime($row['date'])) . "</pubDate>\n";
$length = $row['size'];
@ -284,8 +280,6 @@ if ($result = mysqli_query($connection, $query)) {
}
}
//Display non-connection errors
//Close sql connection
mysqli_close($connection);
echo " </channel>
</rss>