function bg_bibfers_bible_search($atts) { extract(shortcode_atts(array('context' => 'get', 'book' => '', 'ch' => '1-999', 'type' => 'b_verses', 'lang' => '', 'prll' => ''), $atts)); // Если $context задано значение "get", то получаем $context из ссылки if ($context == "get") { $context = $_GET["bs"]; $book = $_GET["book"]; $ch = $_GET["ch"]; if ($ch == "") { $ch = "1-999"; } $l = $_GET["lang"]; if ($l != "") { $lang = $l; } $prll = $_GET["prll"]; if (!isset($_GET["bs"]) && !isset($_GET["book"])) { $keys = array_keys($_GET); $context = $keys[0]; $context = str_replace('_', ' ', $context); $context = trim($context); if ($context == "ch" || $context == "type" || $context == "lang" || $context == "prll") { $context = ''; } } } if ($book) { $book = bg_bibfers_getBook($book); $context = $book . $ch; } $context = trim($context); if (!$context) { return ""; } $quote = bg_bibfers_bible_proc($context, $type, $lang, $prll); if (!$quote || $quote == $context) { $quote = bg_bibfers_search_result($context, $type, $lang, $prll); } if ($quote != "") { $class_val = get_option('bg_bibfers_class'); if ($class_val == "") { $class_val = 'bg_bibfers'; } $quote = "<span class='" . $class_val . "'>" . $quote . "</span>"; } return "{$quote}"; }
function bg_bibfers_convertTitles($q, $type) { if ($type != 'on' && $type != '' && $type != 'quote') { $q = preg_replace("/;/u", '<br>', $q); // Если выводится текст Библии, то замена точки с запятой на перевод строки // Раздел <h3> (Чтение Апостола и Евангелие - по умолчанию) $q = preg_replace("/<em><strong>Евангелие и Апостол:<\\/strong><\\/em><br>/u", '<h3>' . __('Gospel and Apostolic readings', 'bg_bibfers') . '</h3>', $q); $q = preg_replace("/<em><strong>Псалтирь:<\\/strong><\\/em><br>/u", '<h3>' . __('Reading of the Psalms', 'bg_bibfers') . '</h3>', $q); // Названия служб <h4> $q = preg_replace("/<em> На утр.: - <\\/em>/u", '<h4>' . __('At Matins', 'bg_bibfers') . '</h4>', $q); $q = preg_replace("/<em> На лит.: - <\\/em>/u", '<h4>' . __('At Liturgy', 'bg_bibfers') . '</h4>', $q); $q = preg_replace("/<em> На веч.: - <\\/em>/u", '<h4>' . __('At Vespers', 'bg_bibfers') . '</h4>', $q); $q = preg_replace("/<em> На 1-м часе: - <\\/em>/u", '<h4>' . __('At the 1st hour', 'bg_bibfers') . '</h4>', $q); $q = preg_replace("/<em> На 3-м часе: - <\\/em>/u", '<h4>' . __('At the 3rd hour', 'bg_bibfers') . '</h4>', $q); $q = preg_replace("/<em> На 6-м часе: - <\\/em>/u", '<h4>' . __('At the 6th hour', 'bg_bibfers') . '</h4>', $q); $q = preg_replace("/<em> На 9-м часе: - <\\/em>/u", '<h4>' . __('At the 9th hour', 'bg_bibfers') . '</h4>', $q); // Подзаголовки служб <h5> $q = preg_replace("/<em> Ап.: <\\/em>/u", '<h5>' . __('Apostol', 'bg_bibfers') . '</h5>', $q); $q = preg_replace("/<em> Ев.: <\\/em>/u", '<h5>' . __('Gospel', 'bg_bibfers') . '</h5>', $q); // Комментарии $q = preg_replace("/Праздник:/u", __('Reading on holiday:', 'bg_bibfers'), $q); $q = preg_replace("/Ряд.: /u", __('Serial reading:', 'bg_bibfers'), $q); $q = preg_replace("/Под зач.: /u", __('Reading after pericope:', 'bg_bibfers'), $q); } else { // Просто обеспечиваем многоязычность // Раздел <h3> (Чтение Апостола и Евангелие - по умолчанию) $q = preg_replace("/Евангелие и Апостол:/u", __('Gospel and Apostol:', 'bg_bibfers'), $q); $q = preg_replace("/Псалтирь:/u", __('Psalms:', 'bg_bibfers'), $q); // Названия служб <h4> $q = preg_replace("/На утр.:/u", __('At Mat.:', 'bg_bibfers'), $q); $q = preg_replace("/На лит.:/u", __('At Lit.:', 'bg_bibfers'), $q); $q = preg_replace("/На веч.:/u", __('At Ves.:', 'bg_bibfers'), $q); $q = preg_replace("/На 1-м часе:/u", __('At 1st hour:', 'bg_bibfers'), $q); $q = preg_replace("/На 3-м часе:/u", __('At 3rd hour:', 'bg_bibfers'), $q); $q = preg_replace("/На 6-м часе:/u", __('At 6th hour:', 'bg_bibfers'), $q); $q = preg_replace("/На 9-м часе:/u", __('At 9th hour:', 'bg_bibfers'), $q); // Подзаголовки служб <h5> $q = preg_replace("/Ап.:/u", __('Ap.:', 'bg_bibfers'), $q); $q = preg_replace("/Ев.:/u", __('Gos.:', 'bg_bibfers'), $q); // Комментарии $q = preg_replace("/Праздник:/u", __('Holiday:', 'bg_bibfers'), $q); $q = preg_replace("/Ряд.: /u", __('Ser.:', 'bg_bibfers'), $q); $q = preg_replace("/Под зач.: /u", __('After per.:', 'bg_bibfers'), $q); } $q = bg_bibfers_bible_proc($q, $type); return $q; }