Who We Are
bmk
girlie
kristine
Search



Notify List
Let us keep you posted on new entries! Join the notify list!
Blog Status
14 entries
146 comments
12.06.04 11:44 am last update
last 50 referrers

Listed on BlogShares
Syndication
link to us!

virtual venus

virtual venus: MT Wiki
Powered By
because weblogs need love too
Sunday, January 4, 2004
Link to View All Comments for Comment Author

I posted an entry on my Tips Blog on how to show all comments for a particular comment author. In an effort to share the love between my blogs, I'm posting here to tell users how to use this script more dynamically: to create a link in the comment "posted by" line that, when clicked, will generate a list of all comments made by that comment author.

Required: PHP and the MySQL database option in MT

Update 04.15.04: The original code has been updated to strip tags from comment text as a precautionary measure against malicious code.

First, create a new Index Template for the script code (you'll probably want to customize it to match your site design, styles, etc. Just put the code in between the BODY tags where you want it to display). Assign an output file name with a .php extension (mine is called allcomments.php).

Remove these two lines from the code, as you won't need them:

$author = 'girlie';
$email = 'girlie@thegirliematters.com';

Now save your template and rebuild it. (Unless you've got some MT tags that need to be updated regularly, you may want to uncheck the "Rebuild this template automatically" box.)

The next step is to place the code for the link on any template(s) you use to display comments, inside the MTComments tags where you want it to appear:

<a href="<MTBlogURL>allcomments.php?author=<MTCommentAuthor>&email=<MTCommentEmail>" title="view all comments by this author">view all</a>

Remember to change allcomments.php to match your output file path for the new Index Template you created. You may also need to further customize the URL if you set the Index Template to publish in a location other than your Local Site Path.

Rebuild the necessary portions of your site to generate the new links.

Caveat: you can't use the spam_protect attribute on the email address, leaving it vulnerable to spam spiders. If your commenters are consistent about the author name or URL they post with, those are viable alternatives that the script could be modified to use.


Comments: 2

This works great!! Thanks so much, girlie. I have been wanting this for the longest time!

by Al-Muhajabah at 11:07 PM on 01.05.04

im a novice, but I was wondering how I could use this to show all comments by url rather than by email address. that way peoples emails aren't just out there. most people always use the same url anyway. tia :)

by ruthie at 04:43 PM on 02.07.04
Comments are closed on this entry
More Entries

Copyright © Virtual Venus