user-pic

Recent Members, Recent Authors

Vote 0 Votes

I would like a widget that shows the most recent members that have signed on to the system. Another widget might be Recent Authors, showing the authors that have recently posted a post.

I tried to create such a widget, following the structure of Recent Comments, Recent Entries, and Recent Assets, but it doesn't work.

There doesn't seem to be block container tags to show the first and and last of the list, like CommentsHeader or CommentsFooter.

This is way more useful than a list of recent assets.

Way to do?

4 Replies

| Add a Reply
  • Producing a list of members who've recently signed in is probably going to require access to the internal activity log data, and I'm fairly sure there's nothing around that'll do that for you currently. Interesting idea, though. It probably wouldn't take much to create a plugin to get at that information if you poke the right person, though.

    "Authors who recently posted" should in theory(meaning I'm passing through and can't actually try it right now) be nothing more than duplicating the Recent Entries code and outputting mt:EntryAuthor instead of post titles. If that doesn't work, what does come out?

    I'm not quite sure I follow what you're referring to regarding header/footer tags. In the context of what kind of listing? Some of the core loops don't have specific Header/Footer containers, but they do all now have access to the meta-variables, so that's one way of accomplishing the same thing.

  • Thanks Su, the recent entries widget code looks like this:

    <mt:IfNonZero tag="BlogEntryCount"> <mt:Entries lastn="10"> <mt:EntriesHeader> <div class="widget-recent-entries widget-archives widget"> <h3 class="widget-header">Recent Entries</h3> <div class="widget-content"> <ul class="widget-list"> </mt:EntriesHeader> <li class="widget-list-item"><a href="<$mt:EntryPermalink$>"><$mt:EntryTitle$></a></li> <mt:EntriesFooter> </ul> </div> </div> </mt:EntriesFooter> </mt:Entries> </mt:IfNonZero>

    And the recent authors code I tried to create (not having any idea what I'm doing) looks like this:

    <mt:IfNonZero tag="BlogAuthorCount"> <mt:Authors lastn="10" sort_order="descend">

    <div class="widget-new-users widget"> <h3 class="widget-header">New Users</h3> <div class="widget-content"> <ul class="new-users-list">

            &lt;li&gt;&lt;a href=&quot;&lt;mt&#58;AuthorURL &#47;&gt;&quot;&gt;&lt;mt&#58;AuthorDisplayName &#47;&gt;&lt;&#47;a&gt;&lt;&#47;li&gt;
    
        &lt;&#47;ul&gt;
    &lt;&#47;div&gt;
    

    </div>

    &lt;&#47;mt&#58;Authors&gt;
    

    </mt:IfNonZero>

    I've included the Recent Authors widget in the Home Page Widgets group, so if it were working, it should show up on the home page, right?

  • Hmm.. will try that again. The encoding of the code didn't seem to take the last time.

    The recent authors code I tried to create looks like this:

    <mt:IfNonZero tag="BlogAuthorCount"> <mt:Authors lastn="10" sort_order="descend">
    <div class="widget-new-users widget"> <h3 class="widget-header">New Users</h3> <div class="widget-content"> <ul class="new-users-list"> <li><a href="<mt:AuthorURL />"><mt:AuthorDisplayName /></a></li>
    </ul> </div> </div>
    </mt:Authors> </mt:IfNonZero>

  • Okay, I see what you were doing. You were inverting things in the wrong spot. The Authors tag doesn't have a "recently" attribute, so we're not going to use that at all. We're still going to be "listing" recent entries but showing the author information instead:

    <MTEntries lastn="10">
    <p><$MTEntryAuthorDisplayName$></p>
    </MTEntries>
    
    (You can expand upon that as needed.)
    It's a cheat, though, and does bring up an additional consideration: it'll include repeats. For example, if the five most recent entries were by the same person who just went on a posting spree, then their name will show up that many times. If that's a problem, it should be mostly correctable, though it'll take a bit more templating and maybe a plugin.

Add a Reply

Forum Groups

151 405

Last Topic: MT Interface Missing by Sherri on Nov 10, 2008

36 144

Last Topic: Installation can't finish by Drazend on Nov 10, 2008

34 93

Last Topic: Creating your own Plug-in by jondauz on Nov 5, 2008

10 33

Last Topic: new licensing confusion by Neil Epstein on Aug 14, 2008

code.sixapart.com

62 226

Last Topic: Callback after blog publishing. by Tomato Interactive on Oct 27, 2008

34 98

Last Topic: Ajax Rating Plugin by kiran on Oct 17, 2008