Example #1
0
 /**
  * Create an array of values to use in place of variables in template strings
  *
  * @param BfoxRef $ref
  * @return array
  */
 private static function template_vars(BfoxRef $ref)
 {
     $book_name = '';
     $ch1 = $vs1 = 0;
     if ($ref->is_valid()) {
         $bcvs = BfoxRef::get_bcvs($ref->get_seqs());
         $books = array_keys($bcvs);
         $book_name = BibleMeta::get_book_name($books[0]);
         $cvs = array_shift($bcvs);
         $cv = array_shift($cvs);
         list($ch1, $vs1) = $cv->start;
     }
     return array('%ref%' => urlencode($ref->get_string()), '%book%' => urlencode($book_name), '%chapter%' => $ch1, '%verse%' => $vs1);
 }
 function setRef(BfoxRef $ref)
 {
     $this->_ref = $ref;
     $this->_bookName = '';
     $this->_chapterNum = $this->_verseNum = 0;
     if ($this->_ref->is_valid()) {
         $bcvs = BfoxRef::get_bcvs($this->_ref->get_seqs());
         $books = array_keys($bcvs);
         $this->_bookName = BibleMeta::get_book_name($books[0]);
         $cvs = array_shift($bcvs);
         $cv = array_shift($cvs);
         list($this->_chapterNum, $this->_verseNum) = $cv->start;
     }
     foreach ($this->varCallbacks as $var => $callback) {
         $params = array();
         if (isset($this->varCallbackParams[$var])) {
             $params = (array) $this->varCallbackParams[$var];
         }
         $this->varValues[$var] = call_user_func_array($callback, $params);
     }
 }
Example #3
0
 public function book_ref()
 {
     $bcvs = BfoxRef::get_bcvs($this->get_seqs());
     $book_ref = new BfoxRef();
     foreach ($bcvs as $book => $cvs) {
         $book_ref->add_whole_book($book);
     }
     return $book_ref;
 }
Example #4
0
        ?>
			<script type="text/javascript" src="http://www.gnpcb.org/esv/share/js/?action=doPassageQuery&passage=<?php 
        echo urlencode($ref->get_string());
        ?>
&include-audio-link=0&include-copyright=true"></script>
		<?php 
    } else {
        // Begin other translations
        ?>
		<?php 
        // Get the verse data from the bible translation
        $formatter = new BfoxVerseFormatter(TRUE);
        $formatter->use_footnotes(array());
        $books = $trans->get_verses_in_books($ref->sql_where());
        $title = $ref->get_string();
        $bcvs = BfoxRef::get_bcvs($ref->get_seqs());
        ?>
		<?php 
        foreach ($books as $book => $chapters) {
            $title = ' ';
            ?>
			<?php 
            foreach ($chapters as $chapter => $verses) {
                ?>
				<div class="post">
					<?php 
                if (!empty($title)) {
                    ?>
						<h2><?php 
                    echo BfoxRef::create_book_string($book, $bcvs[$book]);
                    ?>