Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsgetting user profile photo URL in reports modulegetting user profile photo URL in reports module
Previous
 
Next
New Post
2/26/2012 3:51 PM
 

Is there a way to get the User Profile Photo using the reports module?

http://www.theaccidentalgeek.com/post/2009/03/27/DNN-Tips-and-Tricks-10-Reports-Module.aspx


This makes it seem possible... but the SQL query doesn't contain any information about getting the photo property?

Thanks!

 
New Post
2/26/2012 6:25 PM
 

Figured it out...


SELECT     TOP (100) PERCENT u.UserID, u.Username, u.LastName, u.FirstName, r.RoleName AS Type, CONVERT(VARCHAR, ur.EffectiveDate, 1) AS Joined, CONVERT(VARCHAR, 
                      ur.ExpiryDate, 1) AS Expires, upd.Photo, upd.Biography, dbo.Files.FileName AS PhotoFileName, dbo.Files.Folder AS PhotoFolder
FROM         dbo.Files INNER JOIN
                          (SELECT     up.UserID, MAX(CASE WHEN ppd.PropertyName = 'Photo' THEN up.PropertyValue ELSE '' END) AS Photo, 
                                                   MAX(CASE WHEN ppd.PropertyName = 'Biography' THEN up.PropertyValue ELSE '' END) AS Biography
                            FROM          dbo.UserProfile AS up INNER JOIN
                                                   dbo.ProfilePropertyDefinition AS ppd ON up.PropertyDefinitionID = ppd.PropertyDefinitionID AND ppd.PortalID = 0
                            GROUP BY up.UserID) AS upd ON dbo.Files.FileId = upd.Photo RIGHT OUTER JOIN
                      dbo.Users AS u INNER JOIN
                      dbo.UserRoles AS ur ON u.UserID = ur.UserID INNER JOIN
                      dbo.Roles AS r ON ur.RoleID = r.RoleID AND (ur.ExpiryDate IS NULL OR
                      DATEDIFF(day, GETDATE(), ur.ExpiryDate) >= 0) ON upd.UserID = u.UserID

 
New Post
10/28/2012 5:25 PM
 
I'm totally appreciative and perplexed... Just last night I was telling my partner that we have a challenge getting the profile photo to display inside of the reports module, and in templates for Ventrian News, UVG, etc. simply because we don't know how to pull the DNN folder path, and the file name....

I'm poking around looking for an answer to another issue (current userid filtering of reports module) and I find your query...

It's awesome... and I really appreciate your contribution. Thank you.
 
New Post
10/29/2012 12:52 AM
 

Scott McCulloch at Ventrian 1-upped it all:
http://www.ventrian.com/blog/getting-...

No Query required!

protected string GetProfileImage(int userId) { return Page.ResolveUrl("~/profilepic.ashx?userid=" + userId.ToString()); }
Go figure

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsReportsReportsgetting user profile photo URL in reports modulegetting user profile photo URL in reports module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out