ThreadList QuertOverrides not working

Developer Space

Developer Space
Want to extend the Telligent Evolution platform? Collaborate with other developers and product experts here.

ThreadList QuertOverrides not working

This question is answered

Hi all,

I'm working on a custom widget which displays recent posts from all groups and forums. (Something similar to the Forum - Thread List widget)

I use sort-by LastPost and sort-order Desc, but the sorting doesn't look right. It actually sorts by last post date, but in a time frame of 24 or more hours it gives me the wrong order.

If I'm not clear enough please see following order:

2-6-2012 7:51 PM

2-6-2012 5:25 PM

2-5-2012 1:30 PM

2-7-2012 5:55 AM

2-7-2012 5:35 AM

2-7-2012 5:26 AM

2-7-2012 5:20 AM

2-7-2012 5:19 AM

2-6-2012 9:28 PM

2-6-2012 9:15 PM

2-6-2012 5:20 PM

<CSForum:ThreadList runat="server" ID="Threads">

   <QueryOverrides GroupID="-1" ForumID="-1" PagerID="ThreadListPager" PageSize="15" IncludeSubGroupSections="true" PopularOnly="false" SortBy="LastPost" SortOrder="Descending" />

...

...

<td class="table-column mostRecentPost">

                   <CSControl:PlaceHolder runat="server">

                           <DisplayConditions><CSForum:ThreadPropertyValueComparison ComparisonProperty="ThreadDate" ComparisonValue="6/8/1980" Operator="GreaterThan" runat="server" /></DisplayConditions>

                           <ContentTemplate>

                               <div class="post-attributesBody">

                                   <CSForum:ForumData runat="server" />

                                   <CSForum:ForumPostList runat="server">

                                   <QueryOverrides runat="server" SortBy="PostDate" SortOrder="Descending" PageSize="1" />

                                   <ItemTemplate>

                                   <CSForum:ForumPostData LinkTo="PostInThread" runat="server" Property="Body" TruncateAt="15" />

                                   </ItemTemplate>

                                   </CSForum:ForumPostList>

                               </div>

                               <CSForum:ThreadData LinkTo="MostRecentPostAuthor" Property="MostRecentPostAuthor" runat="server" TruncateAt="15" LinkCssClass="internal-link view-user-profile" CssClass="user-name" Tag="Span"><LeaderTemplate><div class="post-author"> <CSControl:ResourceControl runat="server" ResourceName="by" />: </LeaderTemplate><TrailerTemplate></div></TrailerTemplate></CSForum:ThreadData>

                               <div class="post-date">

                                   <CSForum:ThreadData Property="ThreadDate" runat="server" IncludeTimeInDate="true" Tag="Span" CssClass="value" FormatString="M-d-yyyy h:mm tt" />

                               </div>

                           </ContentTemplate>

                       </CSControl:PlaceHolder>

           </td>

           </tr>

...

Any suggestion why the sorting is not working would be appreciated.

Thanks

Verified Answer
  • Your post-date div is outputting the date the thread was created at

    <CSForum:ThreadData Property="ThreadDate" runat="server" IncludeTimeInDate="true" Tag="Span" CssClass="value" FormatString="M-d-yyyy h:mm tt" />

    Also note that if there are announcements / stickies in your forum they will always be pinned to the top of the list and you'll have to explicitly exclude them on your QueryOverrides.  The order seems to be fine after the first 3 posts, so my guess is that they're announcements or stickies.

All Replies
  • Hi edinP,

    We will get back to you within 24-48 hours.  Thank you for your patience.

  • I don't see anything wrong with those results.  You're ordering by the date of the *latest* reply however the date you're outputting is the date of the *original post*

    Since you're ordering & displaying different dates, there are no guarantees that the dates you're outputting will be in order.

  • Thanks Alex for your reply.

    I’m a bit confused with what you said. I agree with you that I’m ordering by the date of the *latest* reply with this piece of code:

    <QueryOverrides GroupID="-1" ForumID="-1" PagerID="ThreadListPager" PageSize="15" IncludeSubGroupSections="true" PopularOnly="false" SortBy="LastPost" SortOrder="Descending" />

    But I’m not displaying the date of the *original* (first) post. When I click on the “recent post body” link it shows the last post in the discussion with the same date outputted before the redirect.

  • Your post-date div is outputting the date the thread was created at

    <CSForum:ThreadData Property="ThreadDate" runat="server" IncludeTimeInDate="true" Tag="Span" CssClass="value" FormatString="M-d-yyyy h:mm tt" />

    Also note that if there are announcements / stickies in your forum they will always be pinned to the top of the list and you'll have to explicitly exclude them on your QueryOverrides.  The order seems to be fine after the first 3 posts, so my guess is that they're announcements or stickies.

  • Thanks Alex that solved my problem. It was because of the sticky posts! Thanks again :)