if ( isset( $full_link ) && ! empty( $full_link ) ) {
$metatags .= <<<HTML
<link rel="canonical" href="{$full_link}" />
HTML;
}
if($dle_module == "cat")
{
$cstarts = isset($_REQUEST["cstart"]) ? intval($_REQUEST["cstart"]) : 1;
$cat_cat = !empty($category) ? strip_tags(stripslashes($category)) . '/' : '';
$all_pages_counts = dle_cache( "news_rel_" . $cat_cat, $cat_cat, false);
if($all_pages_counts === false)
{
$all_pages_counts = intval(ceil( $counts_all / $config['news_number'] ));
create_cache ( "news_rel_" . $cat_cat, $all_pages_counts, $cat_cat, false );
}
if($cstarts < 2 && 1 != $all_pages_counts)
{
$next_rel = PHP_EOL . '<link rel="next" href="'. $config['http_home_url'] . $cat_cat . 'page/2' . '">';
$prev_rel = '';
}
else if(1 != $all_pages_counts)
{
if($cstarts >= $all_pages_counts)
$next_rel = '';
else
$next_rel = PHP_EOL . '<link rel="next" href="'. $config['http_home_url'] . $cat_cat . 'page/'. ($cstarts + 1) .'">';
if($cstarts == 2)
$prev_rel = PHP_EOL . '<link rel="prev" href="'. $config['http_home_url'] . $cat_cat . '">';
else
$prev_rel = PHP_EOL . '<link rel="prev" href="'. $config['http_home_url'] . $cat_cat . 'page/'. ($cstarts - 1) .'">';
}
$metatags .= $prev_rel . $next_rel;
}
if ($canonical) {
$metatags .= <<<HTML
<link rel="canonical" href="{$config['http_home_url']}" />
HTML;
}
if ($config['allow_rss']) $metatags .= <<<HTML
<link rel="alternate" type="application/rss+xml" title="{$rss_title}" href="{$rss_url}" />
HTML;