Пример #1
0
 public function __construct($text, $ref_str = '', $page = 0, $trans = '', $group = '')
 {
     $this->set_text($text);
     $trans_ids = BfoxTrans::get_ids_by_short_name();
     $this->display_translation = new BfoxTrans($trans_ids[$trans]);
     if (empty($page)) {
         $page = 1;
     }
     $this->page = $page;
     $this->set_limit(self::results_per_page, self::results_per_page * ($page - 1));
     if (!empty($group)) {
         $this->is_group = true;
         $ref = new BibleGroupPassage($group);
         if ($ref->is_valid()) {
             $this->ref_str = $group;
             $this->ref_where = 'AND ' . $ref->sql_where();
             $this->description .= ' in ' . $this->ref_str;
         }
     } else {
         $this->is_group = false;
     }
     if (!empty($ref_str)) {
         $this->set_ref(new BfoxRef($ref_str));
     }
 }
Пример #2
0
 public static function run($refresh = FALSE)
 {
     global $wpdb;
     $msgs = array();
     // If this is a full refresh, then start by dropping all the possible translation tables
     if ($refresh) {
         $installed = BfoxTrans::get_installed();
         $msgs[] = 'Refresh: Dropping all installed translation tables';
         foreach ($installed as $trans) {
             $wpdb->query("DROP TABLE IF EXISTS {$trans->table}");
             $msgs[] = "Dropped {$trans->table}";
         }
     }
     // Get the translation files
     $files = array();
     $trans_ids = BfoxTrans::get_ids_by_short_name();
     $translations_dir = opendir(self::dir);
     if ($translations_dir) {
         while (($file_name = readdir($translations_dir)) !== false) {
             if (substr($file_name, -9) == '-usfx.xml') {
                 $trans_name = strtoupper(substr($file_name, 0, -9));
                 if (isset($trans_ids[$trans_name])) {
                     $files[$trans_ids[$trans_name]] = $file_name;
                     $msgs[] = "Found translations file: {$file_name}";
                 }
             }
         }
     }
     @closedir($translations_dir);
     $installed = BfoxTrans::get_installed();
     $done_installing = FALSE;
     // Loop through all the translation files we have, and if not installed, install them
     foreach ($files as $id => $file) {
         if (!isset($installed[$id])) {
             if (!$done_installing) {
                 $trans = new BfoxTrans($id);
                 self::create_translation_table($trans);
                 self::load_usfx($trans, $file);
                 $msgs[] = "Installed: {$file} ({$trans->short_name} (ID: {$trans->id}) - {$trans->long_name})";
                 $installed[$id] = $trans;
                 $done_installing = TRUE;
             } else {
                 $msgs[] = "NOTE: Still need to install: {$file}";
             }
         } else {
             $msgs[] = "Skipped: {$file} (already installed)";
         }
     }
     // Enable all the installed translations
     BfoxTrans::set_enabled($installed);
     return $msgs;
 }
Пример #3
0
<?php

// Limit the ref to 10 chapters
$input_ref = new BfoxRef($_REQUEST['bfoxp']);
list($ref) = $input_ref->get_sections(10, 1);
$trans_ids = BfoxTrans::get_ids_by_short_name();
$trans = new BfoxTrans($trans_ids[$_REQUEST['trans']]);
// Get the show options param (default is to show options)
$show_options = !(isset($_REQUEST['opts']) && !$_REQUEST['opts']);
$allow_tooltips = !!$_REQUEST['allow_tooltips'];
// TODO: We shouldn't really use tooltips on the print screen, but use inline scriptures
if (!$allow_tooltips) {
    wp_deregister_script('bfox-blog');
}
// All we need are the scripture styles and script
// TODO: Buddypress is adding a few other syles which we don't need to load here
wp_enqueue_script('bfox-theme-print', BFOX_TRANS_URL . '/theme/print.js', array('jquery'));
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <?php 
language_attributes();
?>
>

	<head profile="http://gmpg.org/xfn/11">
		<meta http-equiv="Content-Type" content="<?php 
bloginfo('html_type');
?>
; charset=<?php