terms('month'); // if nr of rows per month is not set, default to 3 $months_per_row = (!empty($pref['blogcal_mpr'])) ? $pref['blogcal_mpr']: "3"; $pref['blogcal_ws'] = "monday"; // ------------------------------------- // what year are we supposed to display? // ------------------------------------- $cur_year = date("Y"); $cur_month = date("n"); $cur_day = date("j"); if (strstr(e_QUERY, "year")) { $tmp = explode(".", e_QUERY); if (is_numeric($tmp[1])) { $req_year = intval($tmp[1]); } } if (!isset($req_year)) $req_year = $cur_year; // -------------------------------- // look for the first and last year // -------------------------------- $bcSql->db_Select_gen("SELECT news_id, news_datestamp from #news ORDER BY news_datestamp LIMIT 0,1"); $first_post = $bcSql->db_Fetch(); $start_year = date("Y", $first_post['news_datestamp']); $end_year = $cur_year; // ---------------------- // build the yearselector // ---------------------- $year_selector = "
"; $year_selector .= "".BLOGCAL_ARCHIV1.": \n
"; // -------------------------- // create the archive display // -------------------------- $newline = 0; $archive = "
"; $archive .= ""; for($i = 1; $i <= 12; $i++) { if (++$newline == $months_per_row + 1) { $archive .= ""; $newline = 1; } $archive .= "\n"; } $archive .= "
{$year_selector}
"; if(!deftrue('BOOTSTRAP')) { $archive .= "
"; // href the current month regardless of newsposts or any month with news if (($req_year == $cur_year && $i == $cur_month) || $day_links[$i]) { $archive .= "".$marray[$i-1].""; } else { $archive .= $marray[$i-1]; } $archive .= "
"; } if (($req_year == $cur_year) && ($i == $cur_month)) { $req_day = $cur_day; } else { $req_day = ""; } $archive .= "
".calendar($req_day, $i, $req_year, $day_links[$i], $pref['blogcal_ws'])."
"; $ns->tablerender(BLOGCAL_L2 ." $req_year", $archive); require_once(FOOTERF); ?>