SHARE
TWEET

SB translation fix: sb_add_other_bibles

bhengh Jan 25th, 2013 18 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sb_add_other_bibles ($start, $end, $version) {
  2.         if ($version == 'hnv')
  3.                 return '<div class="'.$version.'"><p>Sorry, the Hebrew Names Version is no longer available.</p></div>';
  4.         $reference = str_replace(' ', '+', sb_tidy_reference ($start, $end));
  5.         $old_chapter = $start['chapter'];
  6.         $url = "http://api.preachingcentral.com/bible.php?passage={$reference}&version={$version}";
  7.         $xml = sb_get_xml(sb_download_page($url));
  8.         $output='';
  9.         $items = array();
  10.         $items = $xml->range->item;
  11.         if ($xml->range->item)
  12.                 foreach ($xml->range->item as $item) {
  13.                         if ($item->text != '[[EMPTY]]') {
  14.                                 if ($old_chapter == $item->chapter) {
  15.                                         $output .= " <span class=\"verse-num\">{$item->verse}</span>";
  16.                                 } else {
  17.                                         $output .= " <span class=\"chapter-num\">{$item->chapter}:{$item->verse}</span> ";
  18.                                         $old_chapter = strval($item->chapter);
  19.                                 }
  20.                                 $output .=       $item->text;
  21.                         }
  22.                 }
  23.         return '<div class="'.$version.'"><h2>'.sb_tidy_reference ($start, $end, FALSE, TRUE). '</h2><p>'.$output.' (<a href="http://biblepro.bibleocean.com/dox/default.aspx">'. strtoupper($version). '</a>)</p></div>';
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top