> Forums > Active Forums > Themes and Templates > Pulling info from the DNN profile for display in AF
Last Post 06 May 2009 02:21 PM by Craig Dean. 10 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
wildfire
Customers
wildfire
Post Count:5

--
10 Dec 2008 11:24 AM
    Hi everyone,

    I recently had to have portal wide user images added to member profiles so I added a field to the user profile to store the url of the user's image and then wrote a custom cotrol to allow user's to upload their profile image.

    I then needed to display this same image inside ActiveForums where the avatar would normally be. This had me stumped for a while but was quite easy to solve in the end. I wrote a simple DNN module that retrieves the user's image based on their user id. I added the reference to this at the top of the topicview.txt tempate file:

    <%@ Register TagPrefix="wf" TagName="Image" Src="~/DesktopModules/WildfireUserImage/GetUserImage.ascx" %>


    I was then able to change the template for the forum to include this control on the forum, passing in the userid from the token available in the forum template.

    e.g.

    [DISPLAYNAME][USERSTATUS]
    [USERCAPTION]
    [RANKDISPLAY]
    [RANKNAME]
    Posts:[POSTS]


    <wf:Image runat="server" id="userImage[POSTID]" maxheight="60" maxwidth="60" theuserid="[USERID]" />



    Heh presto the user's image come up on the forum and is used throughout the site too...

    If anyone is interested in more detail on how to do this i can post some more info...
    wildfire
    Customers
    wildfire
    Post Count:5

    --
    10 Dec 2008 11:31 AM
    Apologies the copde example fro the topicview.txt has stripped out the tag for the crucial part. it should look like this:

    [DISPLAYNAME][USERSTATUS]
    [USERCAPTION]
    [RANKDISPLAY]
    [RANKNAME]
    Posts:[POSTS]
    < wf:Image r u n a t ="server" id="userImage[POSTID]" maxheight="60" maxwidth="60" theuserid="[USERID]" />

    N.B. - i've put spaces in runat so the forum doesn't strip the tag!
    Will Morgenweck Forum Admin
    DotNetNuke Staff
    Will Morgenweck
    Post Count:7672

    --
    10 Dec 2008 01:08 PM
    If it is stored in the DNN Profile you can use the following:


    ProfilePropertyName is the name of the field you created for storing the image.
    Will Morgenweck
    Director of Product Management
    DotNetNuke Corp.
    John Henley
    Customers
    John Henley
    Post Count:408

    --
    28 Jan 2009 07:09 PM
    Does this respect the user-specified visibility settings?
    Will Morgenweck Forum Admin
    DotNetNuke Staff
    Will Morgenweck
    Post Count:7672

    --
    28 Jan 2009 07:26 PM
    Yes.
    Will Morgenweck
    Director of Product Management
    DotNetNuke Corp.
    John Henley
    Customers
    John Henley
    Post Count:408

    --
    29 Jan 2009 08:01 AM
    Excellent!
    John Henley
    Customers
    John Henley
    Post Count:408

    --
    20 Feb 2009 08:59 AM
    If I pull a value that is marked private by the user, it displays 'private'. Is there a way to suppress it altogether?
    Craig Dean
    Customers
    Craig Dean
    Post Count:28

    --
    23 Apr 2009 03:35 AM
    I added [DNNROFILE:COMPANY] to my AF 4.0.14 ProfileInfo template, but I get nothing. The company is a list type field I have on profiles. [DNNROFILE:CITY] doesn't show anything either. I tried [ASROFILE:CITY] as well which output the tag (which is what you'd expect as it's unknown).

    The Visibility of all the fields is set to default in AS and Visible in DNN. The fields are populated with data.

    Any suggestions of what I might be doing wrong. We'd really like to see the company of the poster.
    Craig Dean
    Customers
    Craig Dean
    Post Count:28

    --
    23 Apr 2009 03:37 AM
    Sorry that should have been AF 4.1.14, and the tags should say [DNN : PROFILE:COMPANY] (without spaces)
    Will Morgenweck Forum Admin
    DotNetNuke Staff
    Will Morgenweck
    Post Count:7672

    --
    23 Apr 2009 12:24 PM
    The tags are case sensitive. It must match the property name exactly.
    Will Morgenweck
    Director of Product Management
    DotNetNuke Corp.
    Craig Dean
    Customers
    Craig Dean
    Post Count:28

    --
    06 May 2009 02:21 PM
    Thanks that was the solution.

    However, my company property is of type list. Is there any way to format the tag so that it returns the actual value rather than the ID (in a similar way to country, and other list types)?

    Thanks.
    You are not authorized to post a reply.
    > Forums > Active Forums > Themes and Templates > Pulling info from the DNN profile for display in AF
    test
    Copyright 2012 by DotNetNuke Corporation / Terms of Use / Privacy