Fix future feed by removing gomax and adding future switch #55

Merged
ken_fallon merged 1 commits from I54_Future_feed_not_working_after_switching_to_ccdn into main 2024-10-23 08:37:41 +00:00

View File

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