Stump the Panel » End Users and Information Workers

Display the name of most recent person replying to a Discussion Board post

(15 posts)
  • Started 10 months ago by NancyCentury
  • Latest reply from cpoteet
  1. NancyCentury
    Member

    I want to be able to display the name of the person who left the most recent reply to a Discussion Board post. Such a field might be called something like "Last reply by".

    The name displayed in this field will be linked to the number of replies so it changes to reflect the activity on the message board.

    If, for example, the post has 5 replies and the last one was left by Joe Smith at 10 pm, when I view the site I'll see the name of the post, who create it, how many replies there are at that point in time (5) and the name of the last replier (Joe Smith).

    But if I check again at 11 pm and find there are now 10 replies, and the 10th one was left by Jane Doe, that field will now show Jane Doe's name in the "Last reply by" field, NOT Joe Smith's.

    How can I achieve this?

    Posted 10 months ago #
  2. Nancy - I'm not aware of an out of the box solution for that one, but the other guys might have a work around. With "Stump the Panel" in VERY private beta... no announcements except the people who had personally sent me questions... it might take a day or two for the authors to start checking in.

    I'm sure someone will give you something to work with.
    Mark

    Posted 10 months ago #
  3. eodonne
    Member

    Nancy,

    As an avid user of SharePoint, I agree with Mark that there is most likely not an OOTB solution, but I'm curious if someone will reply with a fairly simple solution! Good question!

    Erich

    Posted 10 months ago #
  4. Because of the way discussion data is stored (messages and discussions/folders), you need a CUSTOM web part to display messages grouped by FileRef (dropping the order number) then reverse ordered by order number.

    You can use the truncated FileRef URI to locate the discussion folder. If you want preview text, you'll need a separate query to pull the discussion thread's text.

    None of that is possible OOB. I don't even think it's possible using the CQWP, I think the new web part needs a CAML query to pull the data in the right order.

    Posted 10 months ago #
  5. Nancy,
    Actually, you can accomplish this using a standard "XML" webpart and the "RSS" feed from the discussion list.

    First, go to the "RSS" feed for the list ("Actions > View RSS Feed") and copy the web address (should be something like "http://<your portal>/_layouts/listfeed.aspx?List=<html-encoded Guid of the list>).

    Next, add an "XML" webpart onto the page you want to view the most recent post's details on.

    In the webpart's toolpane you'll see a textbox just under the top button ("XML Editor") where you can paste in the url you copied (textbox is called "XML Link").

    Finally, you'll need to add in some custom XSLT to format the resulting XML and trim down the details to show only the most recent post, the total count for the specific thread, and who it was that posted.

    If you're not too familiar with XSLT you can use the following as a sample to get you started:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <h2>Recent Posting</h2>
    Post Title: <a href="{rss/channel/item/link}">
    <strong>
    <xsl:value-of select="descendant::rss/channel/item/title[1]"/>
    </strong>
    </a>
    <br />
    <xsl:for-each select="rss/channel/item[position() < 2]">
    Number of Replies: <xsl:value-of select="count(//title[.=current()/title])" />
    <br />
    </xsl:for-each>
    <br />
    Posted by: <xsl:value-of select="descendant::rss/channel/item/author[1]"/>
    <br />
    On: <xsl:value-of select="descendant::rss/channel/item/pubDate[1]"/>
    </xsl:template>
    </xsl:stylesheet>

    Hopefully this will get you going in the right direction.

    - Dessie

    Posted 10 months ago #
  6. NancyCentury
    Member

    I never thought of doing it that way... Folks will still need to go to the board to post a reply or read the whole thread, but that will certainly accomplish the basic idea, to show the most recent post. Thanks!!

    Posted 10 months ago #
  7. Based on Dessie's great idea, I have renewed hope for a "most recent reply" column on the forum view.

    If we can capture the reply data into a separate list (via workflow), we may be able to use a linked data source (in SPD) to put that information next to the list of discussion topics in a CQWP or dataview. Think of it as a running audit list on all replies storing the thread, date, created by, and possibly body.

    That would solve a few problems I foresee around RSS time to live (TTL) and data expiration (when a feed returns nothing because post activity slowed). It also keeps records that allow you to see the most recent post for every thread, not just the latest for the forum.

    Dessie at least helped me think outside of "transform this content into the desired form in one step" mentality. Physically scraping and moving some of the data to another list and blending it back together solves most of the problems I mentioned in previous posts without needing a custom solution.

    Posted 10 months ago #
  8. NancyCentury
    Member

    That's what's so great about this forum!

    I understand what you just described, but to implement it is beyond my capabilities right now. But I am glad that I at least can follow what you are saying.

    Posted 10 months ago #
  9. Dessie,

    Great idea.. however, I would like to apply your XSLT skills to another scenario. I would like to allow users to submit famous quotes for a content rotator on my intranet homepage. These can be tips and hints, quotes about life, etc. Currently, I'm doing this through an XML file that I have to hand edit all the time -- not fun. Is there a good way to do this against a custom list? Here's the feed:

    '
    <?xml version="1.0" encoding="UTF-8"?>
    <!--RSS generated by Windows SharePoint Services V3 RSS Generator on 7/24/2008 4:30:12 PM-->
    <?xml-stylesheet type="text/xsl" href="/_layouts/RssXslt.aspx?List=4d259417-ff4d-430e-8ccf-ce1c6c4ce186" version="1.0"?>
    <rss version="2.0">
    <channel>
    <title>SharePoint Training Portal: Quotes</title>
    <link>http://server/Lists/Quotes/AllItems.aspx</link>
    <description>RSS feed for the Quotes list.</description>
    <lastBuildDate>Thu, 24 Jul 2008 21:30:12 GMT</lastBuildDate>
    <generator>Windows SharePoint Services V3 RSS Generator</generator>
    <ttl>60</ttl>
    <image>
    <title>SharePoint Training Portal: Quotes</title>
    <url>/_layouts/images/homepage.gif</url>
    <link>http://server/Lists/Quotes/AllItems.aspx</link>
    </image>
    <item>
    <title>Quote Topic</title>
    <link>http://server/Lists/Quotes/DispForm.aspx?ID=1</link>
    <description><![CDATA[<div><b>Quote:</b> <div>Quote text.</div></div>
    <div><b>Author:</b> Thomas White</div>
    <div><b>Quote Source:</b> Latest News</div>
    <div><b>Subject:</b> Quote Topic</div>
    ]]></description>
    <author>Quick, Chris</author>
    <pubDate>Thu, 24 Jul 2008 21:30:09 GMT</pubDate>
    <guid isPermaLink="true">http://server/Lists/Quotes/DispForm.aspx?ID=1</guid>
    </item>
    </channel>
    </rss>
    '

    If you can come up with an XSLT to display that, I'd be greatful! :)

    Posted 10 months ago #
  10. Chris,
    I'll see what I can come up with :)

    - Dessie

    Posted 10 months ago #
  11. Chris,
    Does this do what you want? (Note the commented sections in the XSLT)

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <a href="{rss/channel/item/link}">
    <strong>
    <!--Quote Topic-->
    <xsl:value-of select="rss/channel/item/title"/>
    </strong>
    </a>
    <br />
    <br />
    <!--Disables output esacaping to render "CDATA" contents-->
    <xsl:value-of select="rss/channel/item/description" disable-output-escaping="yes"/>
    <br />
    <br />
    <!--Quote Author-->
    Submitted By: <xsl:value-of select="rss/channel/item/author"/>
    <br />
    <!--Quote Publish Date-->
    On: <xsl:value-of select="rss/channel/item/pubDate"/>
    </xsl:template>
    </xsl:stylesheet>

    It will display the feed you listed as:

    Quote Topic

    Quote:
    Quote text.
    Author: Thomas White
    Quote Source: Latest News
    Subject: Quote Topic

    Submitted By: Quick, Chris
    On: Thu, 24 Jul 2008 21:30:09 GMT

    Let me know if it's not quite what you want and I'll play with it some more.

    - Dessie

    Posted 9 months ago #
  12. MichaelBorup
    Member

    Hi
    I tried the XML/RSS solution but i get an error:
    'Cannot retrieve the URL specified in the XML Link property. For more assistance, contact your site administrator.' (I am the admin).
    The RSS URL test link works fine in the XML webpart.
    Any solution?

    Thanks in advance.
    /Michael

    Posted 9 months ago #
  13. Make sure your RSS feed comes from a publishing page. Also, if you have modified your authentication using IIS or use something other than NTLM, double-check IIS to make sure the correct auth&auth exists on all subfolders in the virtual directory (especially vti bin).

    Posted 9 months ago #
  14. I'm glad you found a solution Nancy as you also brought it up on Mastering SharePoint.

    Would you be willing to update that thread as well with your answer?

    Posted 9 months ago #

RSS feed for this topic

Reply

You must log in to post.