DotNetNuke ® Portal and Module Development - www.schelian.com

 Search



Forum


 Forum update Minimize

Today: 09/12/2005 we have setup our new dedicated English forum.

From today on, please use this forum instead of the English forums on DNNPortal.DE.

I will lock the English forums on DNNPortal.DE.



 Forum Minimize
SearchForum Home
     
  DNNPortal-Download  Using the DNNPortal-Download  wrong order in ...
 wrong order in the RSS feed
 
imgOfflineJessynoo
2 posts
Joined
3/18/2005

wrong order in the RSS feed
Posted: 19 Oct 05 10:57 PM (France)

Just wanted to blog the download module from dnnPortal.de today, and realized the RSS feed puts the elements in the alphabetic order instead of ordering by published date.

imgOfflineSchelianHP
118 posts
5th
Joined
12/3/2004





Re: wrong order in the RSS feed
Posted: 20 Oct 05 12:40 AM (Germany)

If you don't like the sort order you can simply execute the following sql script in host menu sql, After that you will get the the rss feed in updateddate descending.

START HERE TO COPY

=========================================

if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}{objectQualifier}HPS_DNNPortal_Downloads_GetByModules') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure {databaseOwner}{objectQualifier}HPS_DNNPortal_Downloads_GetByModules
GO

CREATE PROCEDURE {databaseOwner}{objectQualifier}HPS_DNNPortal_Downloads_GetByModules
  @ModuleID int,
  @sFilter nvarchar(256),
  @sSort  nvarchar(100),
  @Approved int,
  @Roles   nvarchar(150),
  @IsAdmin bit

AS

SELECT *, (SELECT COUNT({databaseOwner}{objectQualifier}HPS_DNNPortal_DownloadsComments.ItemID) FROM {databaseOwner}{objectQualifier}HPS_DNNPortal_DownloadsComments
WHERE {databaseOwner}{objectQualifier}HPS_DNNPortal_DownloadsComments.ItemID={databaseOwner}{objectQualifier}HPS_DNNPortal_Downloads.ItemID) AS CommentCount

FROM {databaseOwner}{objectQualifier}HPS_DNNPortal_Downloads

WHERE ModuleID = @ModuleID
AND Approved = @Approved
AND
(
    @sFilter = ''
    OR UPPER(Name) LIKE UPPER('%' + @sFilter + '%')
    OR UPPER(Author) LIKE UPPER('%' + @sFilter + '%')
    OR UPPER(AuthorEMail) LIKE UPPER('%' + @sFilter + '%')
    OR Description LIKE '%' + @sFilter + '%'
)

AND ( (([PublishDate] <GetDate()) or ([PublishDate] is null) ) and ( ([ExpireDate] >= getDate()) or([ExpireDate] is null) ) or @isAdmin = 1)

ORDER BY

CASE @sSort
    WHEN 'Name' THEN Name
    WHEN 'Author' THEN Author
END ASC,

CASE @sSort
    WHEN 'Downloads' THEN Downloads
    WHEN 'RatingAverage' THEN RatingAverage
END DESC,

CASE @sSort
    WHEN 'UpdatedDate' THEN UpdatedDate
    WHEN '' THEN UpdatedDate
END DESC
GO

=================================================

END HERE TO COPY

Hope that helps

HP


Best regards
Hans-Peter Schelian
www.schelian.com (English)
www.schelian.de (Deutsch)
German DotNetNuke Community
imgOfflineJessynoo
2 posts
Joined
3/18/2005

Re: wrong order in the RSS feed
Posted: 20 Oct 05 12:51 AM (France)

Thanks for the custom SProc.

Actually I eventually ended up using this forum's syndication, which is fine as you announce the new downloads there.

That was more a suggestion for the next version; I reckon RSS feeds are naturally meant to be ordered by date since people will generally configure their reader to display the 5 last entries or so to keep up to date with the recent news.

Maybe you should change the sproc by default.

  DNNPortal-Download  Using the DNNPortal-Download  wrong order in ...


Page generated in 0.4375 seconds.