Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-11-21 14:26:50
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Latest comment by?
Can anyone please tell me how to get “Latest comment by Stan” to appear next the the comment count please. I’ve looked every where for an answer but the right place.
Best wishes
Lee
Offline
Re: Latest comment by?
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
#3 2008-11-21 15:25:44
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: Latest comment by?
Thanks very much, I’ll give that a try.
Offline
#4 2008-12-18 00:07:47
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: Latest comment by?
I’ve spent a while searching and probing but haven’t found a plugin or built in way to to do this yet. Anyone want to write a plugin?
Best wishes
Lee
Offline
Re: Latest comment by?
Perhaps this works:
<txp:php>
echo safe_field('name', 'txp_discuss', '1=1 ORDER BY posted DESC LIMIT 1');
</txp:php>
or
<txp:php>
echo get_author_name(safe_field('name', 'txp_discuss', '1=1 ORDER BY posted DESC LIMIT 1'));
</txp:php>
Offline
#6 2008-12-18 00:31:46
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Latest comment by?
Ruud, don’t you know what your own TXP can do? ;)
In the article form:
<txp:if_comments>
[<txp:comments_count />] Latest comment by <txp:comments form="poster" sort="posted desc" limit="1" />
</txp:if_comments>
Form ‘poster’ (type: comment):
<txp:comment_name link="0" />
(edited to remove id
attribute that was still in Textbook, but apparently doesn’t exist anymore and is not needed anymore)
Edit 2: hmm… Textbook shows those id
attributes (that disappeared after 4.0.5) for more comment tags, I’d better tidy up a bit…
Last edited by els (2008-12-18 01:07:33)
Offline
#7 2008-12-18 08:28:27
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: Latest comment by?
Thanks guy’s. I went with what Els said – very clever!
Have a good new year.
Lee
Offline
Pages: 1