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...DNN Platform (o...DNN Platform (o...Populating UsersPopulating Users' Avatars
Previous
 
Next
New Post
7/29/2011 1:53 AM
 
I've got a list of user names and avatars that I'd like to match to the list of users in my DNN6 portal, and update the user's profile avatar when there's a match.

How would I go about updating a user's avatar programatically, given the user's UserID?  As far as I've been able to gather, there's a number stored in the UserProfile table, and the avatar stored in a subdirectory of the portal's /Users directory, but I cannot find a link between the two.
 
New Post
7/31/2011 12:21 AM
 
I think I'm getting closer.  The number in the user's Photo property is a FileID, pointing to a record in the Files table.

So, I think the process for my app (which runs outside of DNN), is:

For each user:
  1. Place new avatar in a folder on the website.
  2. Call the AddFile stored procedure to add a record of the file and generate a FileID.
  3. Call the UpdateUserProfileProperty stored procedure to store the FileID as a Photo property for that user.
 
New Post
7/31/2011 5:46 AM
 
Seems to work so far, except that DNN is wanting its User Pictures to be in the Users/Number/Number/Number folder, so I'm getting a broken link in the Forums.

For myself (with a UserID of 19), I'm given Users/019/19/19/ which makes sense. However, I'm seeing folders such as:

Users/227/83/483/
Users/233/89/489/

At the moment, I'm baffled as to how DNN comes up with these folder names, particularly the number right after Users/ (assuming the next two numbers are the UserID's last two and three digits.
 
New Post
7/31/2011 6:01 AM
 
(To clarify, the image is now being shown on the user's Profile page, but not in the forum module.)
 
New Post
8/1/2011 1:40 AM
 
Finally found what I was looking for in DotNetNuke.Common.Utilities.PathUtils.cs.

The user file path is %Portal%/Users/(UserID AND 255)/(UserID Mod 100)/UserID/, with the first two values padded to three and two digits respectively.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Populating UsersPopulating Users' Avatars


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