Register   Login
     
  Latest Posts  
RE: Search Wildcard Problem!
by georgelew on 1/08/2009 4:19 AM
RE: Does anyone have XHTML Compliant PA Template
by georgelew on 1/08/2009 4:11 AM
RE: Help! Cannot use "&" in CustomField.
by georgelew on 1/08/2009 4:01 AM
RE: Comments not posting
by smcculloch on 1/08/2009 2:55 AM
Does anyone have XHTML Compliant PA Template
by tmahmud on 1/08/2009 1:04 AM
RE: Comments not posting
by WillJean on 1/08/2009 12:53 AM
RE: Comments not posting
by smcculloch on 1/08/2009 12:24 AM
RE: 4.9.0 and 5.0.0 with Simple gallery
by smcculloch on 1/08/2009 12:23 AM
Enable to comment in Simple Gallery
by nmduc073 on 1/07/2009 11:33 PM
Comments not posting
by WillJean on 1/07/2009 11:32 PM
  Forums  
Subject: Albums Sorting
Prev Next
You are not authorized to post a reply.

Author Messages
Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

12/11/2007 6:26 AM  

Is there any way to change the sorting for albums (sub - albums)?  It appears that they are listed in alphabetical order.  What I would like to use is albums sorted by creation date where the newest albums will always be shown at the top of the list.

 

Thanks

 

Patrick

Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

12/12/2007 6:21 AM  
I found manual sorting of the albums, which helps. Hoping that there could be an automatic sort as new albums are added.
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12797


12/12/2007 7:05 AM  
I've added this to the queue of enhancements.

Scott McCulloch
Site Administrator
Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

12/12/2007 8:11 AM  
Thanks. We are using the simple gallery exclusively on our radio stations sites. Just moved over one gallery that has over 2000 images and the next has over 30000.

Patrick
Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

4/29/2008 5:04 PM  
Scott,
Any progress on this? We are working on a redesign of one of the sites and the sorting of the galleries came up. Manually fixing the sort order has worked up till now. If the galleries auto sorted based on date so that new albums always appeared on top the nagging would stop (from my stations that is).

Thought about getting into the code myself but not sure where to start.

BTW - Our audio archives are now set up with News Article on 950espn.com and wmgk.com. Thanks again for the enclosure feature in NA...

Patrick
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12797


5/06/2008 5:26 AM  
I looked at implementing this, but there is no "CreateDate" for an album - this needs to be added in to implement this feature.

Scott McCulloch
Site Administrator
Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

5/06/2008 8:10 AM  
Just spent about an hour modifying the stored procedures to get the sort order that I was looking for. Just kept hacking away until I got what I was looking for.

Patrick

Added "CreateDate" as date to the table (allowing NULLS)

Modified the AlbumAdd to include the CreateDate field:

ALTER PROCEDURE [dbo].[DnnForge_SimpleGallery_AlbumAdd]
@ModuleID int,
@ParentAlbumID int,
@Caption nvarchar(255),
@Description nvarchar(255),
@IsPublic bit,
@HomeDirectory nvarchar(255),
@Password nvarchar(50),
@AlbumOrder int
AS
DECLARE @livedate DATETIME
set @livedate=getdate()

INSERT INTO dbo.DnnForge_SimpleGallery_Album (
[ModuleID],
[ParentAlbumID],
[Caption],
[Description],
[IsPublic],
[HomeDirectory],
[Password],
[AlbumOrder],
[CreateDate]
) VALUES (
@ModuleID,
@ParentAlbumID,
@Caption,
@Description,
@IsPublic,
@HomeDirectory,
@Password,
@AlbumOrder,
@livedate
)

Modified the AlbumListAll SP by getting CreateDate and ordering by that first when Children are not shown.

SELECT
Album.[AlbumID],
Album.[ModuleID],
Album.[ParentAlbumID],
Album.[Caption],
Album.[Description],
Album.[IsPublic],
Album.[HomeDirectory],
Album.[Password],
Album.[AlbumOrder],
Album.[CreateDate],
(select count(*) from dbo.DnnForge_SimpleGallery_Photo where AlbumID = Album.AlbumID and IsApproved = 1) as 'NumberOfPhotos',
(select count(*) from dbo.DnnForge_SimpleGallery_Album where ParentAlbumID = Album.AlbumID and IsPublic = 1) as 'NumberOfAlbums',
(select count(*) from dbo.DnnForge_SimpleGallery_Album a, dbo.DnnForge_SimpleGallery_Photo p where a.ParentAlbumID = Album.AlbumID and a.AlbumID = p.AlbumID and a.IsPublic = 1 and p.IsApproved = 1) as 'NumberOfAlbumPhotos'
FROM
dbo.DnnForge_SimpleGallery_Album Album
WHERE
Album.[ModuleID] = @ModuleID
AND
Album.[ParentAlbumID] = @ParentAlbumID
AND
([Album].[IsPublic] = @ShowPublicOnly OR [Album].[IsPublic] = 1)
ORDER BY
Album.[CreateDate] DESC , Album.[AlbumOrder], Album.[Caption]
END



Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12797


5/06/2008 8:25 AM  
I'm just about to release a build that has this inbuilt :p

Scott McCulloch
Site Administrator
Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

5/06/2008 8:27 AM  
Thanks. Well at least I learned something in the process. :)

PC
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12797


5/06/2008 8:34 AM  
Now in the latest build

Scott McCulloch
Site Administrator
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12797


5/07/2008 5:54 AM  
Did you test it out?

Scott McCulloch
Site Administrator
Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

5/07/2008 8:29 AM  
Yes I did. Many thanks for this feature. Should forward the messages of praise from out promotions directors.

WMGK.com
ILikeBenFM.com
975WJJZ.com

All have the update.

BTW - Thanks for the new release of NA. The role allowed to feature was going to be my next request. :)

Thanks again.

Patrick
Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

5/19/2008 11:48 AM  

Just an update.  The album sorting by Creation Date is working great.  Always want a little more, of course.

Would it be possible to add a [AlbumCreateDate] so that the date can be shown in the template?

 

Thanks

 

Patrick

Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12797


5/20/2008 4:41 AM  
Yep, will do. I'll also add [ALBUMCREATEDATE:XXX] so you can format it how you like it.

Scott McCulloch
Site Administrator
Patrick CouchUser is Offline
Gold Membership
Nuke Active Member
Nuke Active Member
Posts:31

5/20/2008 4:52 AM  
Awesome, thanks.
Scott McCullochUser is Offline
Administrators
Nuke Master
Nuke Master
Posts:12797


7/02/2008 6:40 AM  
[DATECREATED] and [DATECREATED:XXX] now in the release just posted.

Scott McCulloch
Site Administrator
You are not authorized to post a reply.
Forums > Modules > Simple Gallery > Albums Sorting



ActiveForums 3.7