Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Add a page slide show top 20 mediaobject (picture)
manhletien
#1 Posted : Wednesday, 4 May 2011 9:59:53 PM(UTC)
Rank: Member

Joined: 18/01/2011(UTC)
Posts: 8

Hi Rogger! I want to create a page showing 20 recent photos.
Please help me.
Thanks you!
manhletien
#2 Posted : Thursday, 5 May 2011 1:34:06 AM(UTC)
Rank: Member

Joined: 18/01/2011(UTC)
Posts: 8

like best of photo from http://www.marcduerst.com/
Roger Martin
#3 Posted : Thursday, 5 May 2011 8:50:57 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

The API doesn't have anything natively to return the 20 most recent objects, so you'll have to write your own code and SQL query. I need to focus on 2.5 development so maybe somebody else can jump in. You also might contact the guy at http://www.marcduerst.com/.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
manhletien
#4 Posted : Thursday, 5 May 2011 9:19:23 PM(UTC)
Rank: Member

Joined: 18/01/2011(UTC)
Posts: 8

oke, so have the procedures or function get full path when SELECT Top 20 left(gs_MediaObject.Title,50) as title, [MediaObjectId], 'mediaobjects/' + [DirectoryName] + '/' + [OptimizedFilename] as thumb, [gs_MediaObject].[DateAdded]as DateAdded FROM [gs_MediaObject] join [gs_Album] on [FKAlbumId] = [AlbumId] ORDER BY gs_MediaObject.DateAdded DESC

manhletien
#5 Posted : Friday, 6 May 2011 7:50:14 PM(UTC)
Rank: Member

Joined: 18/01/2011(UTC)
Posts: 8

How do I do now?
please help..
when get top 20 mediaobject id. how to display thumbnail images ? And click thumbnail image --> show original..
manhletien
#6 Posted : Wednesday, 18 May 2011 9:24:22 PM(UTC)
Rank: Member

Joined: 18/01/2011(UTC)
Posts: 8

Oki....I think


create function GetFullPath(@AlbumId int )
returns nvarchar(1000)
as
begin
declare @Stop bit, @DirectoryNameFull nvarchar(255), @Parent int, @temp nvarchar(255),@FullDirectoryName nvarchar(255)
set @DirectoryNameFull = ''
if (not exists(select * from gs_Album where AlbumId = @AlbumId))
set @FullDirectoryName = ''
else
begin
set @Stop = 0
while (@Stop = 0)
begin
select @Parent = (select AlbumParentID from gs_Album where AlbumId = @AlbumId)
if (@Parent=1)
begin
set @temp =(select DirectoryName from gs_Album where AlbumId = @AlbumId)
set @DirectoryNameFull = '/' + RTRIM(@temp)+ '/' + LTRIM(@DirectoryNameFull)
set @Stop = 1
end
else
begin
set @temp =(select DirectoryName from gs_Album where AlbumId = @AlbumId)
set @DirectoryNameFull = RTRIM(@temp)+ '/' + LTRIM(@DirectoryNameFull)
set @AlbumId = (select AlbumParentID from gs_Album where AlbumId = @AlbumId)
end
end
end
return @DirectoryNameFull
end
manhletien
#7 Posted : Thursday, 19 May 2011 12:45:47 AM(UTC)
Rank: Member

Joined: 18/01/2011(UTC)
Posts: 8

and call GetFullPath on select:

SELECT Top 20 left(gs_MediaObject.Title,50) as title, [MediaObjectId], 'mediaobjects' + dbo.GetFullPath([gs_Album].AlbumID) + [OptimizedFilename] as thumb, [gs_MediaObject].[DateAdded]as DateAdded FROM [gs_MediaObject] join [gs_Album] on [FKAlbumId] = [AlbumId] ORDER BY gs_MediaObject.DateAdded DESC
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.