scriptygoddess

24 May, 2002

set up a title archive list (MT specific)

Posted by: Jennifer In: Scripts

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…

9 Responses to "set up a title archive list (MT specific)"

1 | Carla

May 25th, 2002 at 1:32 am

Avatar

This isn't related to this entry, but I was wondering about the link to your 50 last referers. Is this something I can do in PHP? Big time novice over here.

2 | Jennifer

May 25th, 2002 at 5:31 am

Avatar

Carla – Yes. That is a PHP script, and you can grab it from little green footballs (scroll down on the left side bar – under scripts – "lgf referrers")

3 | Lynda

May 26th, 2002 at 8:59 am

Avatar

I guess the second part is a space saving device, as MT can easily do that with separate pages… I'm not quite sure why you're using PHP at all though for the first part. I have my posh archives set up with day and title just like that using MT code. Am I missing something?

4 | Jennifer

May 26th, 2002 at 9:05 am

Avatar

If you have your date-based archive set up to just show date and title, then no, this won't be useful. However, I have my date-based archive set up to show all the entries (including the actual post, etc) in the date based archive.

If you just want to see a list of titles of posts (not the whole post) just for a month at a time – then this is what this script would be useful for.

If you have another way, feel free to post it.

5 | Jennifer

May 26th, 2002 at 9:10 am

Avatar

that is – if you want to have the title and date just for the month – but still also also have the month archives set up as I do…

I guess you could do this with custom archive templates – Lynda, feel free to post a tutorial on it. This script was written before the latest version of MT which allows for that.

6 | Melanie

July 5th, 2002 at 9:26 pm

Avatar

I have to admit that this confused me too. I've only been using MT for about two weeks and have (finally) got it to do this for me too.
I use monthly and individual archives to do it, the master archive contains the list of months, the monthly archives contain the list of entry titles, with their date. They link to the individual entry archives.

7 | Cis

July 24th, 2002 at 12:37 am

Avatar

Jennifer-

I've been using part of this for a while now and love it. I was planning to start using the entire thing like [EDITED] your site, but was wondering if there was a way to integrate the code from the collapsing comments & extended entries so that the page isn't being refreshed, just the desired parts expanded and collapsed.

8 | Forest

March 31st, 2003 at 1:19 pm

Avatar

Discovered lgf a couple of days ago. I have mentioned your site on ebiblio.com. I am wondering since this page came up if you know if the search requests script lgf-search-requests.php is also available like the referrers script at lgf.

I am experimenting with some referral scripts with search engine at orggy.com and wonder what you would recommend as a source for global, site wide referrals scripts in general.

9 | Jennifer

March 31st, 2003 at 1:24 pm

Avatar

Forest – lgf-search referral script is here.

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements