A widget for showing your last 10 replies

| 0 TrackBacks
I created this widget in response to this request on the Movable Type forums. It's complicated, but readable. If added to a blog, it will need to be cached using template module caching because it contains several block tags which will do database lookups.

<div class="widget-my-last-replies widget">
    <h3 class="widget-header">My Last Responses</h3>
    <div class="widget-content">
<mt:Comments blog_id="2" sort_order="descend" lastn="100">
    <mt:CommentReplies>
        <mt:If tag="CommenterID" eq="1">
            <mt:setvarblock name="push(permalink)"><mt:commentlink/></mt:setvarblock>
            <mt:setvarblock name="push(entries)"><mt:commententryid/></mt:setvarblock>
            <mt:CommentParent>
                <mt:SetVarBlock name="push(parent)"><mt:CommentAuthor/></mt:SetVarBlock>
            </mt:CommentParent>
        </mt:If>
    </mt:CommentReplies>
</mt:Comments>

<mt:loop name="permalink">
    <ul>
    <mt:If name="__counter__" lt="10">
        <mt:var name="__counter__" setvar="counter"/>
        <mt:var name="counter" op="--" setvar="counter"/>
        <mt:var name="entries[$counter]" setvar="eid"/>
        <li>I <a href="<mt:var name="permalink[$counter]"/>">replied to <mt:var name="parent[$counter]"/><a/> who commented on
        <mt:Entries id="$eid">
            <a href="<mt:EntryPermalink/>"><mt:EntryTitle/></a>
        </mt:Entries>
        </li>
    </mt:If>
    </ul>
</mt:loop>
    </div>
</div>

No TrackBacks

TrackBack URL: http://www.codemonkeyramblings.com/mt/mt-tb.cgi/1778

Recent Entries

There is a pattern here...
Newsweek delivers a smackdown to Murdoch...Instead of stealing, I would call this something else: a free service that drives lots…
They mean "tech neutral" the same way that the perpetually aggrieved classes mean "equal rights"
Composers, music publishers, and songwriters have told federal lawmakers that regardless of whether music is distributed to consumers via TV,…
The 8th circuit court of appeals affirms cops' right to sexually assault women
In a swath of territory covering a good chunk of the midwest, the police are now free to taser a…

Subscribe

Advertisements

OpenID accepted here Learn more about OpenID