if ($static_result['id']) { if ($static_result['allow_count']) { $db->query("UPDATE " . PREFIX . "_static SET views=views+1 WHERE id='{$static_result['id']}'"); } $static_result['grouplevel'] = explode(',', $static_result['grouplevel']); if ($static_result['date']) { $_DOCUMENT_DATE = $static_result['date']; } $disable_index = $static_result['disable_index']; if ($static_result['grouplevel'][0] != "all" and !in_array($member_id['user_group'], $static_result['grouplevel'])) { msgbox($lang['all_err_1'], $lang['static_denied']); } else { $template = stripslashes($static_result['template']); $static_descr = stripslashes(strip_tags($static_result['descr'])); if ($static_result['metakeys'] == '' and $static_result['metadescr'] == '') { create_keywords($template); } else { $metatags['keywords'] = $static_result['metakeys']; $metatags['description'] = $static_result['metadescr']; } if ($static_result['metatitle']) { $metatags['header_title'] = $static_result['metatitle']; } if ($static_result['allow_template'] or $view_template == "print") { if ($view_template == "print") { $tpl->load_template('static_print.tpl'); } elseif ($static_result['tpl'] != '') { $tpl->load_template($static_result['tpl'] . '.tpl'); } else { $tpl->load_template('static.tpl'); }
$count = intval($matches[1]); $row['full_story'] = str_replace("</p><p>", " ", $row['full_story']); $row['full_story'] = strip_tags($row['full_story'], "<br>"); $row['full_story'] = trim(str_replace("<br>", " ", str_replace("<br />", " ", str_replace("\n", " ", str_replace("\r", "", $row['full_story']))))); if ($count and dle_strlen($row['full_story'], $config['charset']) > $count) { $row['full_story'] = dle_substr($row['full_story'], 0, $count, $config['charset']); if ($temp_dmax = dle_strrpos($row['full_story'], ' ', $config['charset'])) { $row['full_story'] = dle_substr($row['full_story'], 0, $temp_dmax, $config['charset']); } } $tpl->set($matches[0], "<div id=\"news-id-" . $row['id'] . "\" style=\"display:inline;\">" . $row['full_story'] . "</div>"); } else { $tpl->set('{full-story}', "<div id=\"news-id-" . $row['id'] . "\" style=\"display:inline;\">" . $row['full_story'] . "</div>"); } if ($row['keywords'] == '' and $row['descr'] == '') { create_keywords($row['short_story'] . $row['full_story']); } else { $metatags['keywords'] = $row['keywords']; $metatags['description'] = $row['descr']; } if ($row['metatitle']) { $metatags['header_title'] = $row['metatitle']; } if (strpos($tpl->copy_template, "[xfvalue_") !== false or strpos($tpl->copy_template, "[xfgiven_") !== false) { $xfieldsdata = xfieldsdataload($row['xfields']); foreach ($xfields as $value) { $preg_safe_name = preg_quote($value[0], "'"); if ($value[6] and !empty($xfieldsdata[$value[0]])) { $temp_array = explode(",", $xfieldsdata[$value[0]]); $value3 = array(); foreach ($temp_array as $value2) {
} else { $replacepage = "<a href=\"{$PHP_SELF}?newsid=" . $row['id'] . "&news_page=\\1\">\\2</a>"; } $row['full_story'] = preg_replace("'\\[page=(.*?)\\](.*?)\\[/page\\]'si", $replacepage, $row['full_story']); $tpl->set('[pages]', ""); $tpl->set('[/pages]', ""); } else { $tpl->set('{pages}', ''); $row['full_story'] = preg_replace("'\\[page=(.*?)\\](.*?)\\[/page\\]'si", "", $row['full_story']); $tpl->set_block("'\\[pages\\](.*?)\\[/pages\\]'si", ""); } } $row['title'] = stripslashes($row['title']); $metatags['title'] = $row['title']; if ($row['keywords'] == '' and $row['descr'] == '' and $config['create_metatags']) { create_keywords($row['full_story']); } else { $metatags['keywords'] = $row['keywords']; if ($row['descr']) { $metatags['description'] = $row['descr']; } else { $metatags['description'] = $row['title']; } } if ($row['metatitle']) { $metatags['header_title'] = $row['metatitle']; } $social_tags['site_name'] = $config['home_title']; $social_tags['type'] = 'article'; $social_tags['title'] = htmlspecialchars($row['title'], ENT_QUOTES, $config['charset']); $social_tags['url'] = $full_link;
} } } else { if ($config['allow_alt_url']) { if (substr($_SERVER['REQUEST_URI'], -1) !== '/' or substr($_SERVER['REQUEST_URI'], -2) === '//') { $stream_page = str_replace($_SERVER['REQUEST_URI'], "/stream/", $_SERVER['REQUEST_URI']); header("HTTP/1.0 301 Moved Permanently"); header("Location: {$stream_page}"); die("Redirect"); } } /*================================== Полный список трансляций в разделе ===================================*/ if ($stream_config['stream_keywords'] == '' and $stream_config['stream_desc'] == '') { create_keywords('stream-info-main'); } else { $metatags['keywords'] = stripslashes($stream_config['stream_keywords']); $metatags['description'] = stripslashes(strip_tags($stream_config['stream_desc'])); } if ($stream_config['stream_title']) { $metatags['header_title'] = $stream_config['stream_title']; } $stream_title = $stream_config['stream_title']; if ($stream_config['cache_allow'] == 'yes') { if ($config['allow_cache'] != 'yes') { $config['allow_cache'] = 'yes'; $cache = true; } $tpl->result['content'] = $dle_api->load_from_cache("stream-info", $stream_config['cachelife']); }