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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesProfile.PhotoURL incorrectProfile.PhotoURL incorrect
Previous
 
Next
New Post
4/5/2011 12:04 PM
 
Hello,

I am trying to display a users profile image and using the DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Profile.PhotoURL property to set the source for an image control. However it seems that it does not return the correct path.

What it is returning: "/Users/029/29/29/1CProfsmall.jpg"
If you go to the profile page itself the source to the image is: http://dnn_dev/LinkClick.aspx?fileticket=TZaVB7BHw9M%3d
And if you find the picture in the directory structure on the file system it is in: Portals\0\Users\029\29\29\1CProfsmall.jpg

I also looked at the DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo.Profile.Photo property. It is returning: 1105. What does that refer to?

A bigger question: What I'd like to achieve, instead of re-creating a profile view, is to display the DNN profile view module within my custom module. Any suggestions on how to do that?
 
New Post
4/6/2011 11:47 AM
 
Chad

This path "/Users/029/29/29/1CProfsmall.jpg" and this one "Portals\0\Users\029\29\29\1CProfsmall.jpg" are the similar. Because prefix "Portals\0" is HomeDirectory for Portal. Please use PortalSettings.HomeDirectoryMapPath or PortalSettings.HomeDirectory (depends what kind of path you need).

When you get 1105 - i bet it belongs to the FileID in the DNN FileSystem. You can work with this file with DotNetNuke.Services.FileSystem.FileController and FileInfo.

Sergey
 
New Post
4/8/2011 1:13 AM
 
Thanks. I got it, but now the property keeps returning "/images/no_avatar.gif", even though if you go the profile, a picture shows up, and the photo property is showing the fileid of 1105.


Dim objUserInfo As UserInfo = UserController.GetUserById(PortalSettings.PortalId, tvwNode.Value)

lblUserDisplayName.Text = objUserInfo.DisplayName
lblUserCity.Text = objUserInfo.Profile.City
lblUserState.Text = objUserInfo.Profile.Region
lnkProfile.PostBackUrl = NavigateURL(PortalSettings.UserTabId, "", "UserId=" + tvwNode.Value)

Dim strProfilePath As String = PortalSettings.HomeDirectory
If objUserInfo.Profile.PhotoURL = "/images/no_avatar.gif" Then

strProfilePath = "~/" & objUserInfo.Profile.PhotoURL.ToString()
Else
strProfilePath = Left(strProfilePath, Len(strProfilePath) - 1) & objUserInfo.Profile.PhotoURL.ToString()

End If

imgProfilePic.ImageUrl = strProfilePath
 
New Post
4/12/2011 12:27 PM
 
This code was working in 5.0 and after upgrading to 5.6.2 it doesn't.

Dim objUserInfo As UserInfo = UserController.GetUserById(PortalSettings.PortalId, tvwNode.Value)
objUserInfo.Profile.PhotoURL

i.e. in 5.0 it was returning the correct path for the profile image, now in 5.6.2 it always returns "/images/no_avatar.gif"

Anyone else experience this?
 
New Post
4/14/2011 4:12 AM
 
Anyone?
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesProfile.PhotoURL incorrectProfile.PhotoURL incorrect


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