<?php
//
// File: archive.php
// License: GNU GPL
//
require_once('./settings.php');
$page_title = 'wheatblog';
include_once("$wb_inc_dir/header.php");
// Connect to the RDBMS and select the database.
$db = DB_connect($site, $user, $pass);
DB_select_db($database, $db);
// select recent posts in the database
$result = DB_query("select *
from $tblPosts
where showpref = '1'
order by year DESC, month DESC, date DESC, id DESC", $db);
// output the current entries
echo("<!-- generated by wheatblog: start -->\n\n");
while($row = DB_fetch_array($result)) {
$the_month = $row["month"];
$the_year = $row["year"];
$archive_start_year = 2000;
$archive_end_year = date('Y');
for($i=$archive_start_year; $i < $archive_end_year; $i++) {
if() {
echo("[<a href=\"./view_by_archive.php?the_year=2004&the_month=03\" title=\"all posts from March 2004\">03</a>]");
}
}
}
?>