forked from HPR/hpr_hub
		
	Added an episode counter for feed generation to determine whether or not to include show notes.
This commit is contained in:
		
							
								
								
									
										10
									
								
								www/rss.php
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								www/rss.php
									
									
									
									
									
								
							| @@ -220,6 +220,7 @@ print "  <atom:link href=\"http://hackerpublicradio.org". str_replace('&', '& | ||||
| print "  <pubDate>".date(DATE_RFC1123, strtotime(date('Y-m-d')))."</pubDate>\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 "    <itunes:author>". $email_padded . " (" . htmlspecialchars(stripslashes(strip_tags($row["host"]))) .")</itunes:author>\n"; | ||||
|     echo "    <googleplay:image href=\"http://hackerpublicradio.org/images/hpr_feed_itunes.png\"/>\n"; | ||||
|     echo "    <link>https://hackerpublicradio.org/eps/hpr".$id."/index.html</link>\n"; | ||||
|     echo "    <description><![CDATA[" . $show_notes . "]]>\n</description>\n"; | ||||
|     if ( $feed === "total" && $ep_count >= 10) { | ||||
|         echo "    <description></description>\n"; | ||||
|     } | ||||
|     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"; | ||||
| @@ -291,6 +297,8 @@ if ($result = mysqli_query($connection, $query)) { | ||||
|     echo "    <guid>" . $url . "</guid>\n"; | ||||
|     echo "  </item>\n"; | ||||
|  | ||||
|     $ep_count ++; | ||||
|  | ||||
|   } | ||||
| } | ||||
| //Display non-connection errors | ||||
|   | ||||
		Reference in New Issue
	
	Block a user