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-28 12:08 AM 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 04: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 05: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:9008
    Avatar

    --
    2010-07-30 03: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 08: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:9008
    Avatar

    --
    2011-06-28 12:08 AM
    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

    RE: DNN site automatically redirects to a different domain name. by imran shaikh
    Thanks for the reply joe this is my portalalias table entries 2 0 localhost/tradeupgrade -1
    RE: "Good" hosting providers by ejcullen rene
    informative!!!
    RE: URL Master Module doesn't work on IHostASP hosting by ejcullen rene
    informative!!!
    RE: shared web hosting by ejcullen rene
    informative!!. i got hosting service from http://www.thewebpole.com/ my hosting company offers you
    RE: iPhone website logo in DNN root directory by JohnnieD
    I'm supposed to add this link to make my custom logo show up on iPhones. Where in DNN would I a
    iPhone website logo in DNN root directory by JohnnieD
    I'm trying to put an iPhone logo that I made into my site so when someone saves the website on their
    RE: Fixed size container by Joseph Craig
    Use an HTML module and style the container to have a fixed height and width. Set the overflow attr
    Fixed size container by Aggiedan97
    I am looking for advice or an actual container that has a fixed height (and width). An HTML module w
    RE: DNN 6.1 app_offline.htm by Joseph Craig
    If the site "works" in Chrome, Firefox and Safari, but not in IE8 look to IE8 as the problem. It is
    RE: DNN site automatically redirects to a different domain name. by Joseph Craig
    Make a copy what is in the portalalias table and then remove all but the localhost entry. Verify th
    DNN 6.1 app_offline.htm by Dave Hassall
    Hi As recommended I have successfully been using the app_offline.htm whilst performing upgrades t
    RE: DNN site automatically redirects to a different domain name. by imran shaikh
    Hi i have done same as mention in this post my dnn folder name is Trademaxomanupg with
    Enforce Terms Tutorial Update by Vistalogix Corporation
    I tried configuring my DNN 6.1.2 install to have a required "accept terms" checkbox as described in
    RE: Best Practices for Modifying a Custom Module by Joseph Craig
    Start up the development website, then install the module using the package that you have. Then, yo
    Best Practices for Modifying a Custom Module by schilders
    Good Morning, I'm needing to modify a custom built module created by another developer targeted f
    RE: Admin menu problem by alireza arabiyan
    hi in localhost i have http://localhost/senf/خانه.aspx and http://localhost/senf/Admi
    RE: Admin menu problem by Joseph Craig
    Yes, that is what you should have done. What is the URL for your home page? What is the URL for
    RE: Admin menu problem by alireza arabiyan
    hi first in localhost i add my domain.com as portal alias. then copy all files to host , restore my
    RE: Admin menu problem by Joseph Craig
    How did you move it? Have you added an entry in the portalalias table for the site's domain name?
    RE: Re: SQL SERVER 2008 R2 Remote connection by Joseph Craig
    Set up a user with dbo privileges and set the connection string for that user, rather than using Win
    You are not logged in.
    You must log in to access all 
    650+ videos, tutorials, podcasts, and more.
    RSS Feeds