Forum

Thread tagged as: Podcasts

New Podcast?

Hi Guys,

I feel like a broken record. I'm setting up a new podcast on a website and the shows/episodes are not displaying in the web browser or in the rss validator.

Here is the webpage: https://livinghopealliance.org/podcasts/index.php It is based off the podcasts/index.php with the '<?php perch_podcasts_shows('s'); ?>'

I know that last time you were talking about the slug. The slug for the show, in the podcast app, show options is lhac https://www.livinghopealliance.org/podcasts/rss.php?s=lhac

Thank you,

Kevin Brandon

Kevin Brandon 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

<?php perch_podcasts_shows('s'); ?>

That's not a valid function call - if you're using perch_podcasts_shows() then the first argument is an options array.

If you want to display details of a show, you can use perch_podcasts_show('slug-of-my-show').

If you want to get episodes of a show, you can use perch_podcasts_episodes('slug-of-my-show')

Thanks Drew, I added the slug 'lhac' to the webpage code on the podcast page <?php perch_podcasts_episodes('lhac'); ?> - yes, I would love to display the episodes, as opposed to the shows, as currently their is only one.

This is the same show slug that I added in the podcast app. The page is still not displaying the two episodes that I have added to the podcast app. Maybe it will take a little bit for the website to display the episodes?

https://livinghopealliance.org/podcasts/index.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

Your page is terminating, which indicates that an error is being thrown. Have you checked your error log?

I checked the error log and found this error:

20151007T080326: livinghopealliance.org/podcasts/index.php PHP Fatal error: Call to undefined function perch_podcasts_episodes() in [long address here]/livinghopealliance/podcasts/index.php on line 41

When I remove the '<?php perch_podcasts_episodes('lhac'); ?>' I can now see the footer displayed at the bottom of the page.

Does this error help at all?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you included the Podcasts app in your config/apps.php ?

There we go - can't believe I missed that simple first step.

Next question on the Podcast, I can see the three episodes listed on the web page: https://livinghopealliance.org/podcasts/

When I click on an episode title/date it takes me to the episodes.php page https://livinghopealliance.org/podcasts/episode.php?s=lhac&ep=3 now this page is not displaying the audio message.

Here is the perch code in the episodes page <?php perch_podcasts_episode(perch_get('lhac'), perch_get('ep')); ?>

My thought is that I am having an error in the RSS Validation where the content in <channel> is not displayed. I assumed that the content for <channel> such as 'description' came from the Podcast App > show options. Yes, there is content in the description.

Any ideas?

Thank you!

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think you want perch_get('s') and not perch_get('lhac').

The template for the main body of the RSS is rss_channel.html. It uses the description and other fields as defined in the show.html template.

Replacing 'lac' with 's' worked perfectly!

I will now go and work on the show.html template file.

Thank you so much for your patience,

We're almost there! Just a quick question on the RSS feed.

Here is the RSS URL for the podcast: https://www.livinghopealliance.org/messages/rss.php?s=lhac

Running the feed through https://feedvalidator.org/ there appears to be the validation errors:

This feed does not validate.

line 6, column 0: Undefined description element: p [help]

<p>Living Hope Alliance Church podcast. Weekly messages from Living Hope All ... line 8, column 4: Undefined channel element: div [help]

<div class="modules">
^

line 126, column 4: Missing channel element: link [help]

</channel>
^

In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendation.

line 126, column 4: Missing atom:link with rel="self" [help]

</channel>

I am unclear on how to clear up these errors.

Any help would be greatly appreciated!

Thank you,

Drew McLellan

Drew McLellan 2638 points
Perch Support

What does your template look like?

Here are the files I have used for the RSS feed. - rss_channel.html - rss_items.html - rss.php - show.html

https://www.dropbox.com/sh/gk2z1ex2r8zz1mc/AAA67e3KL7naY61XucfBKu6ga?dl=0

Thank you,

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think that rss_items.html is what's being used. Can you show me the code you're using to output the feed?

For reference, here's the example page:

<?php
    include('../perch/runtime.php');

    $domain = 'https://'.$_SERVER['HTTP_HOST'];
    PerchSystem::set_var('domain', $domain);
    PerchSystem::set_var('PERCH_EMAIL_FROM', PERCH_EMAIL_FROM);
    PerchSystem::set_var('PERCH_EMAIL_FROM_NAME', PERCH_EMAIL_FROM_NAME);

    header('Content-Type: application/rss+xml');

    echo '<'.'?xml version="1.0" encoding="UTF-8"'.'?>';
?>
<rss xmlns:itunes="https://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
    <?php
        perch_podcasts_show(perch_get('s'), array('template'=>'rss_channel.html'));
        perch_podcasts_episodes(perch_get('s'), array('template'=>'rss_items.html'));
    ?>
</channel>
</rss>

Right, here is the content of the rss.php file:

<?php include('../perch/runtime.php');

$domain = 'https://'.$_SERVER['HTTP_HOST'];
PerchSystem::set_var('domain', $domain);
PerchSystem::set_var('PERCH_EMAIL_FROM', PERCH_EMAIL_FROM);
PerchSystem::set_var('PERCH_EMAIL_FROM_NAME', PERCH_EMAIL_FROM_NAME);


header('Content-Type: application/rss+xml');

echo '<'.'?xml version="1.0" encoding="UTF-8"'.'?>';

?> <rss xmlns:itunes="https://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> <channel> <?php perch_podcasts_show(perch_get('s'), array('template/podcasts/'=>'rss_channel.html')); perch_podcasts_episodes(perch_get('s'), array('template/podcasts/'=>'rss_items.html')); ?> </channel> </rss>

Drew McLellan

Drew McLellan 2638 points
Perch Support

There's no template/podcasts/ option - I think you mean that to be template like the example I gave.

This:

perch_podcasts_show(perch_get('s'), array('template/podcasts/'=>'rss_channel.html'));
perch_podcasts_episodes(perch_get('s'), array('template/podcasts/'=>'rss_items.html'));

should be

perch_podcasts_show(perch_get('s'), array('template'=>'rss_channel.html')); 
perch_podcasts_episodes(perch_get('s'), array('template'=>'rss_items.html'));

Gotcha, good that cleared up the RSS feed with one exception.

The exception is that whenever there is a 's or a - character etc. the Feedvalidator gives an error in the <itunes:subtitle> and the <itunes:summary>.

It does however state that this is a valid RSS feed now. Is that an issue I need to be concerned about?

Thank you,

Drew McLellan

Drew McLellan 2638 points
Perch Support

It says it needs to not contain HTML. Those characters are HTML encoded. Set encode="false" on the tag to prevent the encoding.