Michael over at DrowsyCentral asked me how I set up my title archive list. He also wanted to know how to set up the page so that it showed the posts for just ONE particular month…
First, here's the code that writes all the titles
<?
$j = "";
?>
<p>
<MTArchiveList>
<?
$i = "<$MTArchiveDate format="%B %e, %Y"$>";
if (!strcasecmp($i, $j)) {
//do nothing
} else {
print('</p><p><$MTArchiveDate format="%B %e, %Y"$><br>');
}
$j = "<$MTArchiveDate format="%B %e, %Y"$>";
?>
<MTEntries>
<a href="<$MTArchiveLink$>"><$MTArchiveDate format="%l:%M %p"$>:</a> <i><$MTEntryTitle$></i><br>
</MTEntries>
</MTArchiveList>
Now here's the fun part. The script below will write a page that lists all the months you have archives for. You click on the month, and it will reload the page and list just the entries for that month:
<?
if (isset($showmonth)) {
$j = "";
?>
<p>
<MTArchiveList>
<?
$thismonth = "<$MTArchiveDate format="%B"$>";
$thisyear = "<$MTArchiveDate format="%Y"$>";
if ((!strcasecmp($showmonth, $thismonth)) && (!strcasecmp($showyear, $thisyear)) ) {
$i = "<$MTArchiveDate format="%B %e, %Y"$>";
if (!strcasecmp($i, $j)) {
//do nothing
} else {
print('</p><p><$MTArchiveDate format="%B %e, %Y"$><br>');
}
$j = "<$MTArchiveDate format="%B %e, %Y"$>";
?>
<MTEntries>
<a href="<$MTArchiveLink$>"><$MTArchiveDate format="%l:%M %p"$>:</a> <i><$MTEntryTitle$></i><br>
</MTEntries>
<? } ?>
</MTArchiveList>
<? } ?>
<MTArchiveList archive_type="Monthly">
<a href="<? echo $PHP_SELF ?>?showmonth=<$MTArchiveDate format="%B"$>&showyear=<$MTArchiveDate format="%Y"$>"><$MTArchiveDate format="%B %Y"$></a><br>
</MTArchiveList>
keep in mind, these scipts are pretty much cut and paste – the only thing you need to add is any styling you want…