February 2005 Archives

mtentries lastn alternatives

In a nutshell: how to display entries by last posted NOT by creation date.

I created a blog as an educational outreach for a group of historic interpreters. The blog is actually a fictional "journal" based on several historically-based and fictional personas. One (real live) author creates the entries. The entries are categorized by persona and the "authored on" date is edited to reflect the (fictional) date of the persona's journal entry. (ie. 1771-04-26, 1774-10-17, etc.) Because the entries are posted non-chronologically, I need them to be displayed on the blog in the order they are posted rather than by the MT's default "authored on" (entry_created_on) date. I considered numerous configurations, googled, sweated and googled some more and finally (hallelujah!) came across Brad Choate's MTSQL Plugin. With a little further searching I found Andy C's blog entry with a query that worked for my needs.

Here's how the new tag and query look in my Main Index Template:


<MTSQLEntries query="SELECT entry_id FROM mt_entry LEFT JOIN mt_placement ON placement_entry_id = entry_id WHERE entry_blog_id = X AND entry_status = 2 ORDER BY entry_modified_on DESC LIMIT Z">

</MTSQLEntries>

Above where X is obviously your blog id and Z is the number of posts to be displayed. Entry status 2 displays only published entries. Keep in mind that the query contents all have to be on one line.

On a quest to style comments with alternating background colors (or any style) I chose to employ Adam Kalsey's MT-SimpleComments (w/PHPSimpleComments) plugin. The main feature of this plugin is to integrate trackbacks and comments into one seamless list and provide a unified count of comments and pings together. It also adds the handy dandy <MTSimpleCommentsOdd> tag which specifies 1 for odd- and 0 for even-numbered comments (thus allowing for alternating comment styles). Not that I have a real need for any of that because 1) nobody reads my blogs and 2) even if someone did they'd probably never ping me and again 3) even if they did and left a comment there are unlikely to be THREE comments on any given entry which is what it would take to see the coolness of the alternate styling. BUT, I am SO over that. It is the exercise in plugin and template tweaking that holds the real value for me! :-)

There's always a glitch in the matrix, though, and for me (this time!) it is that v1.32 function.MTSimpleCommentCount.php does not work outside the <MTSimpleComments> tag like it should. To display a unified comment count, I had to use the file from v1.31 available here from the guy who did the first php port of this plugin. I haven't found anyone else with this problem, so perhaps it's just user error. I would be glad to receive any suggestions on this.

Here are the details on how I implemented this plugin both for integration and alternating comment styles on my own sites...

About this Archive

This page is an archive of entries from February 2005 listed from newest to oldest.

January 2005 is the previous archive.

March 2005 is the next archive.

Find recent content on the main index or look in the archives to find all content.