A widget for showing your last 10 replies

| 0 Comments
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>

Leave a comment

March 2010

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Recent Entries

A window into the totalitarian mind of the left on freedom of religion
From Digg: Me: I'm not going to hold my breath waiting for the same liberal democrats who shriek about the…
Google's lossy compiler
Google's closure compiler service gets a little too frisky under ADVANCED_OPTIMIZATIONS. Original code: With advanced optimizations enabled, it was able…
The three purposes of the federal income tax law
Businesses will spend about 3.4 billion man-hours and individuals about 1.7 billion hours figuring out their taxes this year.…

Subscribe

Advertisements

OpenID accepted here Learn more about OpenID