Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Function to display sermons for users to add to their template
- function sb_display_sermons($options = array()) {
- $default = array(
- 'display_preacher' => 1,
- 'display_passage' => 1,
- 'display_date' => 1,
- 'display_player' => 0,
- 'preacher' => 0,
- 'service' => 0,
- 'series' => 0,
- 'limit' => 5,
- 'url_only' => 0,
- );
- $options = array_merge($default, (array) $options);
- extract($options);
- if ($url_only == 1)
- $limit = 1;
- $sermons = sb_get_sermons(array(
- 'preacher' => $preacher,
- 'service' => $service,
- 'series' => $series
- ),
- array(), 1, $limit
- );
- if ($url_only == 1)
- sb_print_sermon_link($sermons[0]);
- else {
- echo "<ul class=\"sermon-widget\">\r";
- foreach ((array) $sermons as $sermon) {
- echo "\t<li>";
- echo "<span class=\"sermon-title\"><a href=\"";
- sb_print_sermon_link($sermon);
- echo "\">".stripslashes($sermon->title)."</a></span>";
- if ($display_passage) {
- $foo = unserialize($sermon->start);
- $bar = unserialize($sermon->end);
- echo "<span class=\"sermon-passage\"> (".sb_get_books($foo[0], $bar[0]).")</span>";
- }
- if ($display_preacher) {
- echo "<span class=\"sermon-preacher\">".__('by', $sermon_domain)." <a href=\"";
- sb_print_preacher_link($sermon);
- echo "\">".stripslashes($sermon->preacher)."</a></span>";
- }
- if ($display_date)
- echo " <span class=\"sermon-date\">".__('on', $sermon_domain)." ".sb_formatted_date ($sermon)."</span>";
- if ($display_player)
- sb_display_mini_player($sermon);
- echo ".</li>\r";
- }
- echo "</ul>\r";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement