Как в хлебных крошках выводить только ID новости DLE 13.2


iccup
95

Как в хлебных крошках выводить только ID новости? DLE 13.2. Вот код из моего engine .php:

if ($config['speedbar'] AND !$view_template ) {


$s_navigation = "<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{$config['http_home_url']}" itemprop="url"><span itemprop="title">" . $config['short_title'] . "</span></a></span>";

if( $config['start_site'] == 3 AND $_SERVER['QUERY_STRING'] == "" AND !$_POST['do']) $titl_e = "";

if (intval($category_id)){

if($titl_e OR (isset($_GET['cstart']) AND intval($_GET['cstart']) > 1) ) {
$last_link = true;
} else $last_link = false;

$s_navigation .= " {$config['speedbar_separator']} " . get_breadcrumbcategories ( intval($category_id), $config['speedbar_separator'], $last_link );

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

if ($config['allow_alt_url']) $s_navigation .= " {$config['speedbar_separator']} <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="" . $config['http_home_url'] . "tags/" itemprop="url"><span itemprop="title">" . $lang['tag_cloud'] . "</span></a></span> {$config['speedbar_separator']} " . $tag;
else $s_navigation .= " {$config['speedbar_separator']} <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="?do=tags" itemprop="url"><span itemprop="title">" . $lang['tag_cloud'] . "</span></a></span> {$config['speedbar_separator']} " . $tag;

} elseif ($nam_e) $s_navigation .= " {$config['speedbar_separator']} " . $nam_e;

if ($titl_e) {

$s_navigation .= " {$config['speedbar_separator']} " . $titl_e;

} else {

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

$page_extra = " {$config['speedbar_separator']} ".$lang['news_site']." ".intval($_GET['cstart']);

} else $page_extra="";

$s_navigation .= $page_extra;

}

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

}
if ($config['speedbar'] AND !$view_template) {
$speedbar_rdfa = 0; //Формат разметки: 1 - RDFa, 0 - обычная микроразметка
$speedbar_prop = array(
'li' => array(
'itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"',
'property="itemListElement" typeof="ListItem"',
),
'a' => array(
//'itemscope itemtype="http://schema.org/Thing" itemprop="item"',
'itemprop="item"',
'property="item" typeof="WebPage"',
),
'ul' => array(
'itemscope itemtype="http://schema.org/BreadcrumbList"',
'vocab="http://schema.org/" typeof="BreadcrumbList"',
),
'span' => array(
'itemprop="name"',
'property="name"',
),
'position' => array(
'itemprop="position"',
'property="position"',
),
);

function getBreadcrumbListCategories($id, $sec = false)
{
global $speedbar,$cat_info,$config,$dle_module;
if (!$id) {
return false;
}
if ($cat_info[$id]['parentid']) {
getBreadcrumbListCategories( $cat_info[$id]['parentid'], true );
}
$speedbar[] = [$config['http_home_url'] . get_url( $id ) . '/', $cat_info[$id]['name'], $cat_info[$id]['metatitle']];
}
$config['speedbar_separator'] = $config['speedbar_separator'] ? trim($config['speedbar_separator']) : "&raquo";
$speedbar = [[$config['http_home_url'], $config['short_title'], $config['home_title']]];

if ($temp = intval($category_id)) {
getBreadcrumbListCategories($temp);
} elseif ($do == 'tags') {
$speedbar[] = array("/tags/", $lang['tag_cloud'] );
$speedbar[] = array("/tags/" . urlencode($tag), $tag);
} elseif ($nam_e) {
$speedbar[] = $nam_e;
}

if ($mod_speedbar) {
$speedbar = array_merge($speedbar, $mod_speedbar);
}
if ($titl_e) {
$speedbar[] = $titl_e;
} elseif (isset($_GET['cstart']) && intval($_GET['cstart']) > 1) {
$speedbar[] = $lang['news_site']." ".intval($_GET['cstart']);
}

$last_item = array_pop($speedbar);
$speedbar[] = is_array($last_item) ? $last_item[1] : $last_item;
foreach ($speedbar as $k => $v) {
if (is_array($v)) {
$speedbar[$k] = "<li {$speedbar_prop['li'][$speedbar_rdfa]}>";
$title_s = "<span {$speedbar_prop['span'][$speedbar_rdfa]}>".(is_array($v) ? $v[1] : $v)."</span>";
$speedbar[$k] .= "<a {$speedbar_prop['a'][$speedbar_rdfa]} href="{$v[0]}" title="".($v[2] ?: $v[1])."">{$title_s}</a>";
$speedbar[$k] .= "<meta {$speedbar_prop['position'][$speedbar_rdfa]} content="" . ($k+1) . "" /></li>"; //$k + 1
} else {
$speedbar[$k] = "<li>$v</li>";
}
}

$tpl->result['speedbar'] = '';
$tpl->load_template('speedbar.tpl');
$tpl->set("{speedbar}", "<ul {$speedbar_prop['ul'][$speedbar_rdfa]} class="speedbar">" . join("<li class="speedbar_sep">{$config['speedbar_separator']}</li>", $speedbar) . "</ul>" );
$tpl->compile('speedbar');
$tpl->clear();
$tpl->result['speedbar'] = '<div id="dle-speedbar">' . $tpl->result['speedbar'] . '</div>';

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *