tips and tricks for movable type

category specific recent comments listing
January 16, 2004

In a recent entry, I showed how I used PHP/MySQL to display the lastn comments from a single category. The code can also be modified for use in a Category Archive page, to show recent comments only for that particular category.

This piece of code from the original entry is the one to modify:

(placement_category_id = 54)

If you only assign one category to each entry in your blog, replace 54 with:

<MTEntries lastn="1">
<MTEntryCategories>
<MTCategoryID>
</MTEntryCategories>
</MTEntries>

If you assign multiple categories to each entry, install the Compare plugin and replace 54 with:

<MTEntries lastn="1"><MTEntryCategories>
<MTIfEqual a="[MTCategoryLabel]" b="[MTEntryCategory]">
<MTCategoryID></MTIfEqual></MTEntryCategories>
</MTEntries>

Inspired by this topic in the MT forum.

Comments

I wanna know what is the table template for the blog body. Ive been trying to do so. but I m bad at doing tables! ;) hehehe hope that you can help me. thanks .

by kay | 01.21.04 02:53 AM

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

TrackBack: 0
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/165)