Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

New, Popular, Favorite Item Lists
Last Post 12/29/2007 2:14 PM by Peter Donker. 4 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Brian
New Member
New Member
Posts:11


--
12/21/2007 8:00 PM

Is there a way to create a list (similar to the list for unapproved items) that can list the most downloaded files, the 10 newest files, and then a list that shows those items that are your favorites (most visited by user or manually tagged as favorite).  If not an inherent feature could this be custom added at a cost?

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
12/26/2007 11:18 PM
Hi Thomas,

There is nothing there out of the box but it could easily be created. One way is to use the reports module of DNN for this. It all depends if you want to incorporate the file's security settings in this or not. I.e. if what you see is the 10 most downloaded files from the files you're allowed to see, or from all existing files.

Peter
Brian
New Member
New Member
Posts:11


--
12/28/2007 1:46 AM
My site has only two user roles, Coaches and Team Members. I would like to have 4 lists (2 variations of 2 lists):
1. one list that shows the top ten downloads for files that are visible to Coaches and Registered Users
2. one list that shows the top ten downloads for files that are visible to Team Members and Registered Users
3. Ten most recently added files visible to Coaches and Registered Users
4. Ten most recently added files visible to Team members and Registered Users.

Can you please help me, I would greatly appreciate it.
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
12/29/2007 2:10 PM
TOP 10 Downloads:

SELECT TOP 10 e.*,
(SELECT [Text] FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.EntryId AND Locale='') Title,
(SELECT COUNT(*) FROM DMX_Log l WHERE l.Action='Download' AND l.EntId=e.EntryId) AS Downloads
FROM DMX_Entries e
INNER JOIN
(SELECT DISTINCT ep.EntryId FROM DMX_EntryPermissions ep INNER JOIN DMX_Permissions pt ON pt.PermissionId=ep.PermissionId
INNER JOIN Roles r ON r.RoleId=ep.RoleId WHERE pt.PermissionKey='VIEW' AND (r.RoleName='Registered Users')) perm ON perm.EntryId=e.EntryId
WHERE
(e.Version=(SELECT MAX(Version) FROM DMX_Entries e2 WHERE e2.LastVersionId=e.LastVersionId AND (e2.IsApproved=1)))
ORDER BY Downloads DESC

NOTE:
1. Adjust the r.RoleName='Registered Users' part to specify the roles for which to list content.
2. This is for a culture neutral list. If you use more locales in your portal and you use the ML features of DMX, then let me know.
3. I did not add {databaseOwner}{objectQualifier} here for clarity's sake. Add if necessary.

Peter
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
12/29/2007 2:14 PM
LAST 10 Additions:

SELECT TOP 10 e.*,
(SELECT [Text] FROM DMX_ShortTexts WHERE TypeKey='ENT' AND SubTypeKey='TITLE' AND ObjectId=e.EntryId AND Locale='') Title,
l.Datime
FROM DMX_Entries e
INNER JOIN
(SELECT DISTINCT ep.EntryId FROM DMX_EntryPermissions ep INNER JOIN DMX_Permissions pt ON pt.PermissionId=ep.PermissionId
INNER JOIN Roles r ON r.RoleId=ep.RoleId WHERE pt.PermissionKey='VIEW' AND (r.RoleName='Registered Users')) perm ON perm.EntryId=e.EntryId
INNER JOIN DMX_Log l ON l.EntId=e.EntryId
WHERE
(e.Version=(SELECT MAX(Version) FROM DMX_Entries e2 WHERE e2.LastVersionId=e.LastVersionId AND (e2.IsApproved=1)))
AND l.Action='Add'
ORDER BY l.Datime DESC

NOTE:
(same as above)
4. This includes folders. If you want to include only files, then include this in the where clause: AND e.EntryType LIKE 'File%'

Peter
You are not authorized to post a reply.