вопрос
Как в модуле календарь выводить только нужные мне категории новостей?
код:
код:
# Выводим архивы
if( $config['allow_archives'] == "yes" ) {
$tpl->result['archive'] = dle_cache( "archives", $config['skin'] );
if( ! $tpl->result['archive'] ) {
$f2 = array ('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12' );
$f3 = array ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
if( intval( $config['no_date'] ) ) {
$thisdate = date( "Y-m-d H:i:s", $_TIME );
$where_date = " AND date < '" . $thisdate . "'";
} else
$where_date = "";
$db->query( "SELECT DATE_FORMAT(date,'%b %Y') AS m_date, COUNT(id) AS cnt FROM " . PREFIX . "_post WHERE approve" . $where_date . " GROUP BY m_date ORDER BY date desc" );
$news_archive = array ();
while ( $row = $db->get_row() ) {
$arch_title['ru'] = str_replace( $f3, $r, $row['m_date'] );
$arch_title['en'] = str_replace( $f3, $f2, $row['m_date'] );
$arch_url = explode( " ", $arch_title['en'] );
$arch_title['en'] = $arch_url[1] . "/" . $arch_url[0];
if( $config['allow_alt_url'] == "yes" ) $news_archive[] = '<a class="archives" href="' . $config['http_home_url'] . $arch_title['en'] . '/"><b>' . $arch_title['ru'] . ' (' . $row['cnt'] . ')</b></a>';
else $news_archive[] = "<a class=\"archives\" href=\"$PHP_SELF?year=$arch_url[1]&month=$arch_url[0]\"><b>" . $arch_title['ru'] . " (" . $row['cnt'] . ")</b></a>";
}
$db->free();
$i = count( $news_archive );
if( $i > 6 ) {
$news_archive[6] = "<div id=\"dle_news_archive\" style=\"display:none;\">" . $news_archive[6];
$news_archive[] = "</div><div id=\"dle_news_archive_link\" ><br /><a class=\"archives\" onclick=\"$('#dle_news_archive').toggle('blind',{},700); return false;\" href=\"#\">" . $lang['show_archive'] . "</a></div>";
}
if( $i ) $tpl->result['archive'] = implode( "<br />", $news_archive );
else $tpl->result['archive'] = "";
create_cache( "archives", $tpl->result['archive'], $config['skin'] );
}
}
$db->query( "SELECT DATE_FORMAT(date,'%b %Y') AS m_date, COUNT(id) AS cnt FROM " . PREFIX . "_post WHERE approve" . $where_date . " GROUP BY m_date ORDER BY date desc" );
заменить на
$db->query( "SELECT DATE_FORMAT(date,'%b %Y') AS m_date, COUNT(id) AS cnt FROM " . PREFIX . "_post WHERE approve and category regexp '[[:<:]](1|2|3)[[:>:]]'" . $where_date . " GROUP BY m_date ORDER BY date desc" );