get($categories->get_id($get['cat']), 'name'); $c['main'] .= "
".$categories->get($categories->get_id($get['cat']), 'description')."
"; $sql_archive = " SELECT ".JLOG_DB_CONTENT.".*, ".JLOG_DB_CONTENT.".date as mysql_date, DATE_FORMAT(".JLOG_DB_CONTENT.".date, '%c') AS month, DATE_FORMAT(".JLOG_DB_CONTENT.".date, '%Y') AS year, UNIX_TIMESTAMP(".JLOG_DB_CONTENT.".date) AS date FROM ".JLOG_DB_CONTENT." LEFT JOIN ".JLOG_DB_CATASSIGN." ON ".JLOG_DB_CONTENT.".id = ".JLOG_DB_CATASSIGN.".content_id WHERE ".JLOG_DB_CATASSIGN.".cat_id = '".escape_for_mysql($categories->get_id($get['cat']))."' AND YEAR(".JLOG_DB_CONTENT.".date) = '".escape_for_mysql($yl->get_selected_year())."' ORDER BY mysql_date DESC;"; $c['main'] .= "".$yl->get_linklist()."
"; } elseif(empty($get['y'])) { $c['meta']['title'] = $l['content_archive_header']; $c['main'] = "\n";
echo $count_query->getError();
echo "\n";
die();
}
$_count = $count_query->fetch();
$count_query->free();
$count = $_count['count'];
}
else {
if(!empty($get['m'])) $where_month = " AND MONTH(date) = '".escape_for_mysql($get['m'])."'";
$c['meta']['title'] = $l['content_archive_header'];
$c['main'] = "".$yl->get_linklist()."
"; } $cc = count_comments(); $archive = new Query($sql_archive); if($archive->error()) { echo "\n";
echo $archive->getError();
echo "\n";
die();
}
$months = array_flip($l['months']);
if($archive->numRows() > 0) {
// initialise variables to keep track of last posts month and year
$last_month = false;
$last_year = false;
while ($daten = $archive->fetch()) {
if(empty($daten)) break 1;
// did we already reach a new month or year?
if (($last_month != $daten['month']) OR ($last_year != $daten['year'])) {
if ($last_month) { $c['main'] .= " \n"; }
$c['main'] .= "