tips and tricks for movable type
recent comments listing
November 01, 2002
SunMark asked for the code I use to list Recent Comments in my sidebar. Here it is!
• <MTCommentAuthorLink spam_protect="1">: <MTCommentBody convert_breaks="0" trim_to="50" remove_html="1">
<MTCommentEntry>
[<a href="<MTEntryLink archive_type="Individual">">entry</a>]
</MTCommentEntry><br />
</MTComments>
TrackBack: 13
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/107)
» Alarm
Excerpt:
This is a picture that I took on my birthday. It was cold slushy rain fell and Sami and I ran inside...
Weblog: Garden Apartment
Tracked: 01.15.03 09:53 PM
» No I wasn't on vacation!
Excerpt: Its been almost ten days since my databases corrupted and that left me unable to blog and update all my other web sites, including BowlingFans.com. I had pretty recent backups of every thing but I didn't have backups of my
Weblog: #!/usr/bin/geek
Tracked: 02.21.03 02:18 AM
» Crap at work
Excerpt: Well things at work are certainly starting to snowball. I don't think the upper management realizes how fragile things have become. The combination of poor communications on the part of upper management, our new company culture (which is to the...
Weblog: My blog 'n stuff
Tracked: 04.08.03 09:17 PM
» Movable Type Enhancements
Excerpt: In trying to determine whether Movable Type (MT) was a feasible backend for OK/Cancel, I found a variety of sites and discovered just how big the MT community really was. If there's a function you can think of (and many...
Weblog: my:dentity
Tracked: 09.28.03 11:33 AM
» MT Tweaks
Excerpt: General, indispensible links for MT setup and configuration include: Movable Type, the girlie matters, Empty Pages, Scriptygoddess, and CSS Zen Garden. To minimize the tehno-babble on this blog while keeping track of this behemoth project, here is the ...
Weblog: patchwork progression
Tracked: 11.01.03 03:11 AM
» Afficher les 5 derniers commentaires
Excerpt: <MTComments lastn="5" sort_order="descend"> • <MTCommentAuthorLink spam_protect="1">: <MTCommentBody convert_breaks="0" trim_to="50" remove_html="1"> <MTCommentEntry> [<a href="<MTEntryLink archive_type="Individ...
Weblog: Weblogger.ch
Tracked: 11.17.03 08:24 AM
» Most recent comments
Excerpt: Since I lost my main index, and didn't have backups, I had to rebuild everything. One of the things I used to have was a most recent comments list. When I rebuilt, I grabbed the most recent code I could...
Weblog: blogroll.co.uk
Tracked: 01.26.04 06:38 PM
» Recent Comments
Excerpt: Listing comments recently made to on one's weblog is becoming more popular these days. To add a Recent Comments section to the main page of your weblog, add the following code to the sidebar section of the Main Index Template....
Weblog: Learning Movable Type
Tracked: 02.29.04 04:14 PM
» Recent Commentary
Excerpt: Thanks to the girlie who matters at http://www.thegirliematters.com/ as Google led me to her site when I was having trouble with the "recent comments" code. She seems to be some sort of Uber-OverMind about all things Movable Type. At this...
Weblog: Hand/Eye Blog
Tracked: 03.11.04 03:22 PM
» Boxes or No Boxes?
Excerpt: Another new item was added to the sidebar. Now I finally have a "Recent Comments" section. I wanted this, because today I got a comment to an older entry. I removed the "Recent Entries" section, because the sidebar was too...
Weblog: arved's weblog
Tracked: 04.01.04 09:39 AM
» Boxes or No Boxes?
Excerpt: Another new item was added to the sidebar. Now I finally have a "Recent Comments" section. I wanted this, because today I got a comment to an older entry. I removed the "Recent Entries" section, because the sidebar was too...
Weblog: arved's weblog
Tracked: 04.01.04 12:32 PM
» Recent Comments working again.
Excerpt: Janine's Blog: Recent Comments I did a search on the internet and managed to get the recent comments working again using some code found [the girlie matters] here - tips and tricks: recent comments listing...
Weblog: Janine's Blog
Tracked: 05.28.04 05:00 AM
» Recent Comments working again.
Excerpt: Janine's Blog: Recent Comments I did a search on the internet and managed to get the recent comments working again using some code found [the girlie matters] here - tips and tricks: recent comments listing...
Weblog: Janine's Blog
Tracked: 05.28.04 05:02 AM
Comments
Yay! Thanks!
Having problems with the "[Entry]" code...
Error I'm getting: Build error in template 'Main Index': Error in <MTComments> tag: Error in <MTEntryLink> tag: You used an 'MTEntryLink' tag outside of the context of an entry; perhaps you mistakenly placed it outside of an 'MTEntries' container?
Are you using the code exactly as I have it above? MTEntryLink needs to either be inside the MTCommentEntry or MTEntries container tags.
Yeah, using it exactly as you have it. Odd. I'm using MT v2.21... might that have anything to do with it?
Yes, MTCommentEntry was added in 2.5 - that's what made the listing possible whereas it wasn't before (i.e., in the version you're using).
Interesting. I've gotten it to work in 2.2-- thanks for your help. Any suggestions on how to add a search function to my blog-- Google's FreeSearch, Atomz Search, MT-Search for 2.2?
Hmmm, interesting indeed. MTCommentEntry was definitely added in 2.5 (I double-checked the changelog).
MT 2.5+ integrates MT-Search, so I've switched to using that instead of PicoSearch.
How's the upgrade from MT 2.2 to 2.5?
What specifically do you mean?
Just wondering if it's a simple file plop or if I'll have to configure a bunch of stuff...
Are you using MySQL? If so, there is an upgrade script to run after uploading the latest copies of the files. If not, it's just the upload files part. More in the Upgrade instructions.
You may want to also download the full version of 2.51 just to get a look at the latest mt.cfg file - there are several new options in it due to the integration of MT Search. Or you can just check out the new section of the Users Manual titled Configuration Settings to see what you might need/want to add to your original mt.cfg file.
How do I get the entry with most comments script?
See this entry.
Thank you! I just pasted your code into my MT index and it worked great!
What's the script for "most commented visitor " ? And I have been testing my blog to see if I can trackback. I use a track back link from another blog on my site and put it on the main blog but it pings to an older entry. Me sending pings is fine but receiving pings from my other blogs doesnt ping right :-/
I don't know what happen but this script is not working properly for me. It just shows the up to 5 comments for a particular entry instead of the last 5 from whatever entry.
Did you inadvertently put it inside of an MTEntries container?
No the thing was i put it in the archives so when you view the archives it only shows it for that entry but it works fine on the index.
Hey do you want me to link the tips or the index?
It will be under my resources once I construct that page.
Thank you!
This is a great tip, thanks. What if I want my comment to break after a certain number of characters? What I want specifically is the first 25 chars of the comment on one line, and the next 25 on another. Is this possible?
Great tip, where did you find the doc on trim_to and remove_html? That wasn't in the MT 2.5 doc for the MTCommentBody tag.
Those are in the Template Tag manual under Global Tag Attributes - they can be used on any variable tag.
Thanks again!
That code worked great, thanks so much for making it available!
it works great! thanks!!
Yes! I agree, very great. Couldn't figure it out on my own so I appreciate the help. Cheers!
-leon
I tried to copy and paste this just as it is into my blog design, but it isn't working. I just get [">entry]. Any ideas what might be causing it? Thanks in advance.
Big fat DUH! I designed my layout using PHP and didn't load the "header" into my MT templates. When I did that (at the advice of a wonderful buffy of mine) it worked.
Thanks for this code! I love it!!
Buddy!! BuDDy. (can you tell I'm a Mutant Enemy fan) ;)
Just wanted to say thanks for the code.
This was working great but now it won't even show up. Go check it out, its on my right sidebar. It wont load anymore! I didnt do anything to break it! what happened!
I tried your tip, but it did not work. I found a way to get the recent comments with the number of comments showing. Just put it in the main index, or other places you might want it. Here's the code:
<div class="sidetitle">
Recent Comments
</div>
<div class="side">
<MTEntries recently_commented_on="5" sort_order="ascend">
<a href="<$MTEntryPermalink$>"><$MTEntryTitle$> (<$MTEntryCommentCount$>)</a><br />
</MTEntries><br />
</div>
Sorry about the last post, kinda messt it up :( But that's it!!!
For some reason I get a comments (#) link on the index page for each post that day. How can I get just the one - to the story I currently have on the front page?
Any suggestions would be great!
The code I'm using:
<MTEntryIfAllowComments><a href="<$MTEntryPermalink$>#comments"><font color="#FF0000">Comments </font>(<$MTEntryCommentCount$>)</a> </MTEntryIfAllowComments>