The module wasn't written in a very generic way ... when we do modules just for ourselves, we tend to take shortcuts with the data adaptors, etc. But here is the code for the SP that will select a random file and display info for it, you could use it as the basis for your display module.
Note that my moduleId is hardcoded - you may want to make that a parameter also so the display is more generic.
CREATE PROCEDURE dbo.Repository_ShowRandomRecord
@category nvarchar(25)
AS
-- GET A RANDOM TESTIMONIAL
declare @quick_tip_id int
declare @rand_num int
declare @num_recs int
-- Get Random Number from number of records
select @num_recs = count(obj.itemid) FROM grmRepositoryObjects obj INNER JOIN grmRepositoryCategories cat
ON ';' + obj.CategoryID + ';' LIKE '%;' + CAST(cat.ItemID AS nvarchar(5)) + ';%'
WHERE obj.ModuleID = 1837
AND cat.Category = @category
-- Select a random number between 1 and the number
-- of records in our table
-- Rounding error corrected by Finn Gundersen; old version commented below
-- set @rand_num = Round(((@num_recs - 1) * Rand() + 1), 0)
set @rand_num = Round(@num_recs * Rand() + 1, 0, 1)
-- Create a local, static, read-only, scrollable cursor
-- Needs scrollable to use fetch absolute, otherwise we
-- would use forward-only
declare #mycursor cursor scroll static read_only for
--select itemid from grmrepositoryobjects where moduleid = 1837
select obj.itemid FROM grmRepositoryObjects obj INNER JOIN grmRepositoryCategories cat
ON ';' + obj.CategoryID + ';' LIKE '%;' + CAST(cat.ItemID AS nvarchar(5)) + ';%'
WHERE obj.ModuleID = 1837
AND cat.Category = @category
open #mycursor
fetch absolute @rand_num from #mycursor into @quick_tip_id
close #mycursor
deallocate #mycursor
--select @quick_tip_id
-- Select the columns from the table joined for the key
-- selected from the cursor
select obj.itemid as itemid, obj.moduleid as moduleid, isnull(name,'') as title, isnull(author,'') as author, isnull(description,'') as detail FROM
grmrepositoryobjects obj --right join grmRepositoryCategories cat on cat.moduleid = obj.moduleid
where obj.itemid = @quick_tip_id
--and cat.category = @category
GO