function bfox_ajax_send_bible_text() { sleep(1); set_bfox_ref(new BfoxRef($_POST['ref_str'])); ob_start(); load_bfox_template('admin-bfox_tool'); $content = ob_get_clean(); $content = addslashes(str_replace("\n", '', $content)); $script = "bfox_quick_view_loaded('{$ref_str}', '{$content}');"; die($script); }
function bfox_bp_bible_directory_before_activity_loop() { $ref = bfox_ref(); // Try to get a ref from the REQUEST params if there isn't already an active ref if (!empty($_REQUEST['bfox_ref']) && !$ref->is_valid()) { $ref = new BfoxRef(urldecode($_REQUEST['bfox_ref'])); if ($ref->is_valid()) { set_bfox_ref($ref); } } if ($ref->is_valid()) { // Make sure our bible references get added to the search terms add_filter('bp_ajax_querystring', 'bfox_bp_bible_directory_querystring', 20, 2); // Enable search term refs bfox_bp_activity_enable_search_term_refs(); // Disable the search term refs after the activity loop add_action('bp_after_activity_loop', 'bfox_bp_activity_disable_search_term_refs'); } }
function bfox_tool_update_ref_str($ref_str) { // Bible Tools need to have a Bible Reference $ref = bfox_ref(); if (!$ref->is_valid()) { // If no Bible reference is passed in try to use the last viewed ref if (empty($ref_str)) { $ref = new BfoxRef(bfox_tool_last_viewed_ref_str()); } else { $ref = new BfoxRef($ref_str); } // If we still don't have a valid ref, use Genesis 1 if (!$ref->is_valid()) { $ref = new BfoxRef('Genesis 1'); } // Set the active Bible reference set_bfox_ref($ref); } $ref_str = $ref->get_string(); // Save the ref_str as the last viewed ref str bfox_tool_set_last_viewed_ref_str($ref_str); return $ref_str; }
/** * Creates the form displaying the scripture quick view * */ function bfox_blog_quick_view_meta_box() { global $post_ID; $ref = bfox_blog_post_get_ref($post_ID); if (!empty($_REQUEST['bfox_ref'])) { $ref->add_string($_REQUEST['bfox_ref']); } $is_valid = $ref->is_valid(); if ($is_valid) { $ref_str = $ref->get_string(); } set_bfox_ref($ref); // Create the form load_bfox_template('edit_post-bfox_tool'); }