You need to Register for free and Login to post a message in the forum.

Forum

DotNetNuke User Profile v5.4 - Issue 58
Last Post 2011-06-27 11:08 PM by Joseph Craig. 4 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Lee SykesUser is Offline
DNN Creative Staff
Nuke Master VI
Nuke Master VI
Posts:4945
Avatar

--
2010-06-30 03:38 PM
    Add any comments or questions regarding the DotNetNuke User Profile v5.4 tutorial from Issue 58
    Lee Sykes
    Site Administrator
    Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

    Twitter: www.twitter.com/DNNCreative

    Lee Sykes's Facebook Profile
    jerimiahpettigrewUser is Offline
    Nuke Newbie
    Nuke Newbie
    Posts:2

    --
    2010-07-29 04:05 PM
    How do you make the "my folder" option the only visible option for the profile image upload....instead of seeing all of the other folders...giving users the options to upload their images to folders that you dont want images stored in
    Joseph CraigUser is Online
    DNN Creative Support
    Nuke Master VI
    Nuke Master VI
    Posts:9299
    Avatar

    --
    2010-07-30 02:29 AM
    In the file manager, set the permissions so that logged in users (registered users) have write permission only to that folder.  You might want to hide most folders from all but admins, but make sure that doing so doesn't break anything on your site.

    Joe Craig, DNN Creative Support

    Subscribe to DNNCreative
    I recommend PowerDNN for DotNetNuke Hosting.
    d_atlUser is Offline
    Nuke Newbie
    Nuke Newbie
    Posts:2

    --
    2011-06-27 07:25 PM
    Is there a way to show the user profiles for a role?
    IE. I have a role "Manager" and want a page Managers that list each user profile name, picture, description for the role "Managers"
    Joseph CraigUser is Online
    DNN Creative Support
    Nuke Master VI
    Nuke Master VI
    Posts:9299
    Avatar

    --
    2011-06-27 11:08 PM
    No, that functionality doesn't exist.

    However ...it wouldn't be too terribly hard to do. You'll have to know some programming. I'd start with Joe Brinkman's article at http://blog.theaccidentalgeek.com/p...Nuke.aspx. This shows you how to display a single profile. I'd wrap that inside something that selects all of the users in a role.

    I've actually "sort of" done this for another application (using Razor). Here is my sloppy Razor code. You can install a Razor Host module on an administrative page, and paste the code in as a new script. The first line of the script shows how to specify the role, in this case it is "subscribers." You'll have to work a little bit harder if you want to have the role selectable.


    @using DotNetNuke.Security.Roles
    @using DotNetNuke.Entities.Users
    @using DotNetNuke.Common.Utilities
    @using DotNetNuke.Common
    @using DotNetNuke.Entities.Profile
    @using DotNetNuke.Entities.Portals
    @using System.Web

    @{
    var users = (new RoleController()).GetUsersByRoleName(Dnn.Portal.PortalId, "Subscribers");
    }


    @foreach (UserInfo user in users)
    {


    Profile Photo for @user.DisplayName

    @user.FirstName @user.LastName
    @GetFormattedCityState(user.Profile, " ( {0} )")


    @GetFormattedProfileProperty(user.Profile, "JobTitle", @"
    {0}
    ")



    @Server.HtmlDecode(@GetFormattedProfileProperty(user.Profile, "Biography", "
    {0}
    "))

    }


    @functions {
    public static string GetProfileUrl(UserProfile profile)
    {
    string strPhotoURL = Globals.ApplicationPath + "/images/no_avatar.gif";
    ProfilePropertyDefinition objProperty = profile.GetProperty("Photo");
    if (objProperty != null &&
    string.IsNullOrEmpty(objProperty.PropertyValue) == false &&
    objProperty.Visibility == UserVisibilityMode.AllUsers)
    {
    DotNetNuke.Services.FileSystem.FileController objFiles = new DotNetNuke.Services.FileSystem.FileController();
    DotNetNuke.Services.FileSystem.FileInfo objFile = objFiles.GetFileById(int.Parse(objProperty.PropertyValue), objProperty.PortalId);

    // There is a bug in the Photo profile property that stores the host photo
    // in the Current Portal and not in the host portal (-1). To overcome this
    // bug we just look in the current Portal if we can't find a photo in the Profile Portal
    if (objFile == null)
    {
    objFile = objFiles.GetFileById(int.Parse(objProperty.PropertyValue), objProperty.PortalId);
    }

    if (objFile != null)
    {
    PortalInfo objPortal = (new PortalController()).GetPortal(objFile.PortalId);
    if (objPortal != null)
    {
    strPhotoURL = string.Format("{0}/{1}/{2}", Globals.ApplicationPath, objPortal.HomeDirectory, objFile.RelativePath);
    }
    }
    }
    return strPhotoURL;
    }

    public static string GetProfileProperty(UserProfile profile, string propertyName)
    {
    ProfilePropertyDefinition objProperty = profile.GetProperty(propertyName);
    if (objProperty == null || string.IsNullOrEmpty(objProperty.PropertyValue)) return string.Empty;

    return objProperty.PropertyValue;
    }

    public static string GetFormattedProfileProperty(UserProfile profile, string propertyName, string tagformat)
    {
    string propertyval = GetProfileProperty(profile, propertyName);
    if (propertyval != string.Empty)
    {
    return string.Format(tagformat, @propertyval);
    }

    return string.Empty;
    }

    public static string GetFormattedCityState(UserProfile profile, string tagformat)
    {
    string theCity = GetProfileProperty(profile, "City");
    string theState = GetProfileProperty(profile, "Region");
    string theString = string.Empty;

    if( theCity != string.Empty )
    {
    theString = theCity;
    if( theState != string.Empty )
    {
    theString += ", " + theState;
    }
    else theString = theState;
    }

    if (theString != string.Empty)
    {
    return string.Format(tagformat, @theString);
    }

    return string.Empty;
    }

    }




    Joe Craig, DNN Creative Support

    Subscribe to DNNCreative
    I recommend PowerDNN for DotNetNuke Hosting.
    You are not authorized to post a reply.


    Active Forums 4.3

    Latest Forum Posts

    FCK Editor in DNN 6 by WinXnet
    is there a way to get the FCK editor working in DNN 6 - it has stopped funcitoning properly after an
    Rename or move site from domain name to subdomain name by Bill Quinn
    Hi, I have an old DNN site on a a TLD like this: websitename.com I have created a portal on
    RE: Deploying dnn by Sameer
    Thanks joeseph glad with your answer it means i can use CE for my site if the traffic are not
    Unable to Create Skin Package by schilders
    Hi, I'm trying to create the skin package and manifest for my new skin. I created the new skin e
    RE: user adding images by Joseph Craig
    I think that you will need to go to the File Manager and give the user and/or security group file up
    RE: lightroom effect for skin by Joseph Craig
    There are modules available that do this. On the commercial side, I've used Mandeeps' Live Conten
    RE: Creating structured page content by Joseph Craig
    Take a look at Ventrian's News Articles module. While commercial, it has a very modest price! Th
    Creating structured page content by Stephen Bugden
    Hi, Can anyone recommend a module for creating and managing page content? The kind of thing I'
    lightroom effect for skin by everett31
    I’m looking for a way to add the lightbox effect to a skin file. I would like the end user to have
    RE: css3-mediaqueries.js and Dynamic Forms Crash Page in IE by WinXnet
    According to my web searching, @font-face references cause crashing in IE7 and IE8 with css3-mediaqu
    user adding images by rod lloyd
    I have set up permissions for certain users to edit a module, but when they log-on and enter Edit Co
    RE: Deploying dnn by Joseph Craig
    The free Community Edition of DotNetNuke is perfectly fine for creating "world class" websites. Whi
    RE: css3-mediaqueries.js and Dynamic Forms Crash Page in IE by WinXnet
    any idea what approach I should take - IE completely locks up. The only cause is the combo of the
    RE: css3-mediaqueries.js and Dynamic Forms Crash Page in IE by Joseph Craig
    If you're up to doing some debugging, you might be able to figure out where the problem lies. That'
    RE: Deploying dnn by Sameer
    Hi Joe Thanks for your reply i am planning to create my own DNN site so for that i have chec
    RE: css3-mediaqueries.js and Dynamic Forms Crash Page in IE by WinXnet
    Thanks for the response, but I was hoping it was something I could fix with some skin tweaks - one i
    RE: Changing Search text by Joseph Craig
    You will want to look here for references about the DotNetNuke skin objects. The document written b
    Changing Search text by Abraham Tameru
    Hi, Instead of having "Search" text near the search text box, I wanted to replace it by an image
    RE: Strange issue with file manager on sub domain (sperate portal) by Web Services
    Just sent it.
    RE: Not able to load my dotnetnuke website on Internet Explorer though it is working fine with other browsers by Joseph Craig
    Did you get this fixed? (Apologies for not getting to this sooner...)
    You are not logged in.
    You must log in to access all 
    650+ videos, tutorials, podcasts, and more.
    RSS Feeds