Tetrogrammaton

Рейтинг
5
Регистрация
18.03.2012

WebAlt спасибо вам большое!

Ура, все работает как надо!

Здравствуйте! Пожалуйста помогите мне найти переменную с названием категории для вывода в title на Dle 9.6

вот тема /ru/forum/755466

Смотрите - все работает WebAlt, спасибо вам большое!

Вот часть кода engine.php

		//####################################################################################################################

// Просмотр кратких новостей
//####################################################################################################################


$_SESSION['referrer'] = $_SERVER['REQUEST_URI'];

if ($catalog != "") {

$cache_prefix = "_catalog_" . $catalog;

} elseif ($do == "lastnews") {

$cache_prefix = "_lastnews";

} elseif ($subaction == 'allnews') {

$cache_prefix = "_allnews_". $user;

} elseif ($do == 'tags') {

$cache_prefix = "_tagscl_". $tag;

} elseif ($do == 'xfsearch') {

$cache_prefix = "_xfsearch_". $xf;

} else {

$cache_prefix = "_";

if ($month) $cache_prefix .= "month_" . $month;
if ($year) $cache_prefix .= "year_" . $year;
if ($day) $cache_prefix .= "day_" . $day;
if ($category) $cache_prefix .= "category_" . $category;
}

$cache_prefix .= "_tempate_" . $config['skin'];

if (isset($view_template) AND $view_template == "rss") {

if ($catalog) $active = dle_cache ( "rss", $catalog, false );
else $active = dle_cache ( "rss", $category_id, false );

} else {

if ($is_logged and ($user_group[$member_id['user_group']]['allow_edit'] and ! $user_group[$member_id['user_group']]['allow_all_edit'])) $config['allow_cache'] = false;
if (isset($_SESSION['dle_no_cache']) AND $_SESSION['dle_no_cache']) $config['allow_cache'] = false;
if ($cstart) $cache_id = ($cstart / $config['news_number']) + 1;
else $cache_id = "1";

if ($cache_id < 6 and !isset ( $_POST['login'] )) $active = dle_cache ( "news", $cache_id . $cache_prefix, true );
else $active = false;

}

if ($active) {

$tpl->result['content'] .= $active;
$active = null;
if ($config['allow_quick_wysiwyg'] and ($user_group[$member_id['user_group']]['allow_edit'] or $user_group[$member_id['user_group']]['allow_all_edit'])) $allow_comments_ajax = true;
else $allow_comments_ajax = false;

} else {

include_once (ENGINE_DIR . '/modules/show.short.php');

if (! $config['allow_quick_wysiwyg']) $allow_comments_ajax = false;

if ($config['files_allow'] == "yes") if (strpos ( $tpl->result['content'], "[attachment=" ) !== false) {
$tpl->result['content'] = show_attach ( $tpl->result['content'], $attachments );
}

if (isset($view_template) AND $view_template == "rss" AND $news_found) {

if ($catalog) create_cache ( "rss", $tpl->result['content'], $catalog, false );
else create_cache ( "rss", $tpl->result['content'], $category_id, false );

} elseif ($news_found and $cache_id < 6) create_cache ( "news", $tpl->result['content'], $cache_id . $cache_prefix, true );

}

}

}

/*
=====================================================
Вывод заголовка страницы
=====================================================
*/
$titl_e = '';
$nam_e = '';
$rss_url = '';

if ($do == "cat" and $category != '' and $subaction == '') {

$metatags['description'] = ($cat_info[$category_id]['descr'] != '') ? $cat_info[$category_id]['descr'] : $metatags['description'];
$metatags['keywords'] = ($cat_info[$category_id]['keywords'] != '') ? $cat_info[$category_id]['keywords'] : $metatags['keywords'];

if ($cat_info[$category_id]['metatitle'] != '') $metatags['header_title'] = $cat_info[$category_id]['metatitle'];
else $nam_e = stripslashes ( $cat_info[$category_id]['name'] );

if ($config['allow_alt_url'] == "yes") {
$rss_url = $url_page . "/" . "rss.xml";
} else {
$rss_url = $config['http_home_url'] . "engine/rss.php?do=cat&category=" . $cat_info[$category_id]['alt_name'];
}

} elseif ($subaction == 'userinfo') {
$nam_e = $user;

if ($config['allow_alt_url'] == "yes") {
$rss_url = $url_page . "/" . "rss.xml";
} else {
$rss_url = $config['http_home_url'] . "engine/rss.php?subaction=allnews&user=" . urlencode ( $user );
}

} elseif ($subaction == 'allnews') {
$nam_e = $lang['show_user_news'] . ' ' . $user;

if ($config['allow_alt_url'] == "yes") {
$rss_url = $config['http_home_url'] . "user/" . urlencode ( $user ) . "/" . "rss.xml";
} else {
$rss_url = $config['http_home_url'] . "engine/rss.php?subaction=allnews&user=" . urlencode ( $user );
}

} elseif ($subaction == 'newposts') $nam_e = $lang['title_new'];
elseif ($do == 'stats') $nam_e = $lang['title_stats'];
elseif ($do == 'addnews') $nam_e = $lang['title_addnews'];
elseif ($do == 'register') $nam_e = $lang['title_register'];
elseif ($do == 'favorites') $nam_e = $lang['title_fav'];
elseif ($do == 'pm') $nam_e = $lang['title_pm'];
elseif ($do == 'feedback') $nam_e = $lang['title_feed'];
elseif ($do == 'lastcomments') $nam_e = $lang['title_last'];
elseif ($do == 'lostpassword') $nam_e = $lang['title_lost'];
elseif ($do == 'search') $nam_e = $lang['title_search'];
elseif ($do == 'static') $titl_e = $static_descr;
elseif ($do == 'lastnews') $nam_e = $lang['last_news'];
elseif ($do == 'alltags') $nam_e = $lang['tag_cloud'];
elseif ($do == 'tags') $nam_e = $tag;
elseif ($do == 'xfsearch') $nam_e = $xf;
elseif ($catalog != "") {
$nam_e = $lang['title_catalog'] . ' &raquo; ' . $catalog;

if ($config['allow_alt_url'] == "yes") {
$rss_url = $config['http_home_url'] . "catalog/" . urlencode ( $catalog ) . "/" . "rss.xml";
} else {
$rss_url = $config['http_home_url'] . "engine/rss.php?catalog=" . urlencode ( $catalog );
}

}
else {

if ($year != '' and $month == '' and $day == '') $nam_e = $lang['title_date'] . ' ' . $year . ' ' . $lang['title_year'];
if ($year != '' and $month != '' and $day == '') $nam_e = $lang['title_date'] . ' ' . $r[$month - 1] . ' ' . $year . ' ' . $lang['title_year1'];
if ($year != '' and $month != '' and $day != '' and $subaction == '') $nam_e = $lang['title_date'] . ' ' . $day . '.' . $month . '.' . $year;
if (($subaction != '' or $newsid != '') and $news_found) $titl_e = $metatags['title'];

}

if (intval($_GET['cstart']) > 1 ){

$page_extra = ' &raquo; '.$lang['news_site'].' '.intval($_GET['cstart']);

} else $page_extra = '';

if ($nam_e) {

$metatags['title'] = $nam_e . $page_extra . ' &raquo; ' . $metatags['title'];


$rss_title = $metatags['title'];

} elseif ($titl_e) {

$metatags['title'] = $titl_e . $page_extra . ' &raquo; ' . $config['title'];

} else $metatags['title'] .= $page_extra;

/* для сео заменено на нижнее if ( $metatags['header_title'] ) $metatags['title'] = stripslashes($metatags['header_title'].$page_extra); */
//разные title для страниц пагинации, для первой полный title, для пагинации короткий
if ($do == "cat" and $category != '' and $subaction == '') { //если категория
if ( $metatags['header_title'] and ! $page_extra ) $metatags['title'] = stripslashes($metatags['header_title']);
else $metatags['title'] = stripslashes($cat_info[$category_id]['name']) . $page_extra;
} elseif ($dle_module == "main") { //если главная страница
if ( ! $page_extra ) $metatags['title'] = stripslashes($config['home_title']);
else $metatags['title'] = stripslashes($config['short_title']) . $page_extra;
} elseif ($metatags['header_title']) $metatags['title'] = stripslashes($metatags['header_title']);
//разные title для страниц пагинации, для первой полный title, для пагинации короткий




if ( $disable_index ) $disable_index = "\n<meta name=\"robots\" content=\"noindex,nofollow\" />"; else $disable_index = "";

if (! $rss_url) {

if ($config['allow_alt_url'] == "yes") {
$rss_url = $config['http_home_url'] . "rss.xml";
} else {
$rss_url = $config['http_home_url'] . "engine/rss.php";
}

$rss_title = $config['home_title'];
}

$metatags = <<<HTML
<meta http-equiv="Content-Type" content="text/html; charset={$config['charset']}" />
<title>{$metatags['title']}</title>
<meta name="description" content="{$metatags['description']}" />
<meta name="keywords" content="{$metatags['keywords']}" />{$disable_index}
<meta name="generator" content="DataLife Engine (http://dle-news.ru)" />
<link rel="search" type="application/opensearchdescription+xml" href="{$config['http_home_url']}engine/opensearch.php" title="{$config['home_title']}" />
HTML;

if ($config['allow_rss']) $metatags .= <<<HTML

<link rel="alternate" type="application/rss+xml" title="{$rss_title}" href="{$rss_url}" />
HTML;

/*
=====================================================
Формирование speedbar
=====================================================
*/
if ($config['speedbar'] and ! isset ( $view_template )) {

$s_navigation = "<a href=\"{$config['http_home_url']}\">" . $config['short_title'] . "</a>";

if ($category_id) $s_navigation .= " &raquo; " . get_categories ( $category_id );
elseif ($do == 'tags') {

if ($config['allow_alt_url'] == "yes") $s_navigation .= " &raquo; <a href=\"" . $config['http_home_url'] . "tags/\">" . $lang['tag_cloud'] . "</a> &raquo; " . $tag;
else $s_navigation .= " &raquo; <a href=\"?do=tags\">" . $lang['tag_cloud'] . "</a> &raquo; " . $tag;

} elseif ($nam_e) $s_navigation .= " &raquo; " . $nam_e;

if ($titl_e) $s_navigation .= " &raquo; " . $titl_e;

$tpl->load_template ( 'speedbar.tpl' );
$tpl->set ( '{speedbar}', '<span id=\'dle-speedbar\'>' . stripslashes ( $s_navigation ) . '</span>' );
$tpl->compile ( 'speedbar' );
$tpl->clear ();

}
?>