Help - Search - Members - Calendar
Full Version: a unique url for each comment
Movable Type Community Forum > Additional Resources > Tips and Tricks
robbear7
Is it possible to call for a single comment within a page instead of a string of all comments? Each comment is assigned a unique ID right? Does that mean a link could be formed to grab that particular comment and nothing else?

Thanks for any idea's or suggestions.
LisaJill
Comment Permalinks

but that's just an anchor in the list of comments. I don't know how to grab eachcomment on its own page.
robbear7
That's a good idea, but it just will not work for what I need. There has got to be some way to grab individual comments. smile.gif
LisaJill
I think it would require some querying of sql, unfortunately that is beyond what I know, and I don't see any plugins that look useful for it =/
kadyellebee
Hmmm, I'm not remembering a solution for that. Maybe the Entry Plugin could be modified to allow for specification of a certain comment id.

Is PHP/MySQL an option? Lisa's right, that would be something do-able.

Maybe if you explain what you are trying to do, we'd have a better idea for you. smile.gif

Kristine
robbear7
I thought I had it figured out for a moment. Using this string didn't quite work:
CODE
mt-comments.cgi?entry_id=76&comment_id=13

It still displayed comments ID'd 13 and 14. Bleh. I feel like I am getting close though. Any idea's anyone?
robbear7
QUOTE (kadyellebee @ Feb 4 2004, 03:10 AM)
Hmmm, I'm not remembering a solution for that.  Maybe the Entry Plugin could be modified to allow for specification of a certain comment id.

Is PHP/MySQL an option?  Lisa's right, that would be something do-able.

Maybe if you explain what you are trying to do, we'd have a better idea for you. smile.gif

Kristine

What I ultimately want to do is display a listing of comments linked to that comment entry. Upon clicking it should load only that comment in an iframe.

Generating the list without the actual comment is easy enough, however singling out each comment is drawing me a blank.

I do have PHP/MySQL avaialble if that helps.
kadyellebee
Yeah, I tried that mt-comments.cgi URL by adding comment_id onto it too - but had the same results as you.

I wonder if you could modify the Show/Hide javascript to display the comment only after you clicked it in the iframe. Although I don't know that much about how regular windows and iframes work together. (there are quite a few versions of that javascript floating around - scriptygoddess has one if you search over there.)

Are you going to have specific comments that you are going to be linking? Is that why you are wanting to specify it by the actual comment_id?
a select statement for this with MySQL and PHP or even the MT SQL plugin could look something like this:
CODE
SELECT comment_id FROM mt_comments WHERE comment_id='13'

if that makes no sense, I can write it out in more complete terms; I'm just not sure if that's really gonna be helpful to you if you have to specify the ID number for each one you want to display. smile.gif

Kristine
girlie
CODE
SELECT comment_id FROM mt_comments WHERE comment_id='<MTCommentID>'


??
kadyellebee
Yeah, but Girlie, its gonna have to be in the context of MTComments for that to work, right? So then he'd still be listing all of the comments, not just a specific one. I bet I'm just really confused now, though wink.gif
jayseae
I hacked Search.pm to return only a single entry (and specifically it's associated comments). I haven't looked at it, but I'd suspect that the search function may be able to be modified to return only a single comment, which could go through a different template to produce the results wanted.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.