$correct_links = contentHelper::strtolower_ru($tpl['biblio']['data']["name"]) . "_n" . $tpl['biblio']['data']["biblio"] . ".html"; if ("/biblio/" . $correct_links != urldecode($_SERVER['REQUEST_URI'])) { header('HTTP/1.1 301 Moved Permanently'); header('Location: ' . $cfg['site_dir'] . "biblio/" . $correct_links); die; } $tpl['breadcrumbs'][] = array('text' => 'Библиотека нумизмата', 'href' => $cfg['site_dir'] . 'biblio', 'base_href' => $cfg['site_dir'] . 'biblio'); $tpl['breadcrumbs'][] = array('text' => $tpl['biblio']['data']['name'], 'href' => '', 'base_href' => ""); $mytext = str_replace(chr(13), "<br>", $tpl['biblio']['data']['text']); $mytext = str_replace("<<<", "<img src={$biblioimagesfolder}/", $mytext); $mytext = str_replace(">>>", ">", $mytext); $tpl['biblio']['data']['text'] = str_replace("`", "'", $mytext); $tpl['pages'] = array(); if (!$tpl['biblio']['data']['parent']) { //является вершиной дерева $sql = "select biblio,name from biblio where parent='{$biblio}' order by biblio;"; $tpl['pages'] = $biblio_class->getDataSql($sql); foreach ($tpl['pages'] as $i => $rows1) { $tpl['pages'][$i]['correct_link'] = contentHelper::strtolower_ru($rows1["name"]) . "_n" . $rows1["biblio"] . ".html"; } } else { //является лепестком $sql = "select biblio,name from biblio where biblio='" . $tpl['biblio']['data']['parent'] . "' or parent='" . $tpl['biblio']['data']['parent'] . "' order by parent, biblio;"; $tpl['pages'] = $biblio_class->getDataSql($sql); foreach ($tpl['pages'] as $i => $rows1) { $tpl['pages'][$i]['correct_link'] = contentHelper::strtolower_ru($rows1["name"]) . "_n" . $rows1["biblio"] . ".html"; } } $biblioByKeywords = $biblio_class->getBiblioByKeywords($keywords, $biblio); $newsbyKeywords = $biblio_class->getNewsByKeywords($keywords, $biblio);