You don’t need to display your podcasts on your web pages; you can provide a link to your RSS feed and your visitors will be able to view your podcasts in their favorite podcast reader. But if you want to provide an automatic list on any web page, you can.
The easiest way to display your podcasts on your web page is to include podcast.phpi and use the “podcast” function.
<? include_once('/web/includes/podcasts.phpi'); podcast(); ?>
It will automatically detect the account that owns the current page and display podcasts from that page.
If you want to use the default styles for the podcast list, you’ll need to include the styles in the <head> area of your document.
<? include_once('/web/includes/podcasts.phpi'); podcastStyles(); ?>
By default the podcast function will show the four most recent items. You can specify different numbers of items as an option to the function:
<? podcast(10) ?>
Sometimes you need more control over which podcasts are displayed. For example, you might want to display some faculty members’ podcasts on a page that isn’t managed by those faculty. For this, you can create a podcast feed “object” and then specify the account you want to display:
<? include_once('/web/includes/podcasts.phpi'); $podcast = new Podcast('faculty1'); $podcast->showList(3); $podcast->account('faculty2'); $podcast->showList(); ?>
You must specify how many items you want the first time you call showList, but afterwards it will remember your choice.
If you want to use the default podcasts style sheet, use $podcast->HEAD() in the <head> area of your document.
If you need it, “showList” returns the number of items displayed. You might use this to display a special message if no items were displayed, for example.
You can list the feeds associated with the podcast using $podcast->showFeeds().
If you need a specific channel, specify it using the channel() method.
You can provide your own custom style sheet in addition to or in replacement of the default style sheet. The podcasts are displayed as a “dl” list of class “podcasts”. The title of the podcast is in the “dt” tag and the rest is in the “dd” tag. The information (size, duration, date published) is in a “span” of class “info”.
- MySQL for Other Applications
- Creating queries in MySQL. Useful if you use MySQL in PHP, Dreamweaver, Python, or Perl, or similar. October 31, 2013, 1.7 MB, 52 pages (download)
- Video Podcast
- Video podcast about an audio podcast. October 12, 2012, 34.0 MB, 1 minute, 19 seconds (download)
- PHP for Dynamic Web Pages
- PHP excels at embedding dynamic text into static text. It is also useful for displaying databases on the web. August 16, 2012, 2.3 MB, 58 pages (download)