How to use DNN profile image as users avatar in instant messenger.

Last post 08-27-2010, 4:39 PM by soyemil. 4 replies.
Sort Posts: Previous Next
  •  08-20-2010, 2:35 PM 63545

    How to use DNN profile image as users avatar in instant messenger.

    Can anyone point me in the right direction in order to use the DNN profile image as a users avatar in the cute chat instant messenger?
  •  08-24-2010, 10:52 AM 63588 in reply to 63545

    Re: How to use DNN profile image as users avatar in instant messenger.

    anybody? pleeeeeeeeeeeeeeeeeease
  •  08-26-2010, 11:58 PM 63686 in reply to 63588

    Re: How to use DNN profile image as users avatar in instant messenger.

    Hi soyemil,
     
    Please tyr this way
     
    1.       Open file “DesktopModules\CuteSoft_Client\CuteChat\Script\ChatUI.js”

    2.       Find section below

    function ChatUI_GetInstantAvatar(user)

    {

             var atype="Messenger";

             var avatar=user.PublicProperties.InstantAvatar||"";z

             return CuteChatUrlBase+"DrawAvatar.Ashx?Avatar="+escape(avatar)+"&AvatarType="+atype;

    }

     3.       Change it to

    function ChatUI_GetInstantAvatar(user)

    {

             var atype="Messenger";

             var avatar=user.PublicProperties.InstantAvatar||"";

     

             return CuteChatUrlBase+"DrawAvatar.Ashx?Avatar="+user.UserId+"&AvatarType="+atype;

    }

     4.       Open file “\DesktopModules\CuteSoft_Client\CuteChat\DrawAvatar.Ashx” and delete all code in this page

     5.       Add the code below into the page above “DrawAvatar.Ashx”
    1. <%@ WebHandler Language="C#" Class="DrawAvatar" %>   
    2.   
    3. using System;   
    4. using System.Web;   
    5. using System.Web.UI;   
    6.   
    7. public class DrawAvatar : IHttpHandler   
    8.   
    9. {   
    10.   
    11.     public void ProcessRequest(HttpContext context)   
    12.   
    13.     {   
    14.   
    15.         string avatar = context.Request.QueryString["Avatar"];   
    16.   
    17.         string type = context.Request.QueryString["AvatarType"];   
    18.   
    19.         DotNetNuke.Entities.Portals.PortalSettings ps = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings();   
    20.   
    21.         DotNetNuke.Entities.Users.UserInfo user = DotNetNuke.Entities.Users.UserController.GetUserByName(ps.PortalId, avatar.Substring(5));   
    22.   
    23.         if (user.Profile.Photo != null)   
    24.   
    25.         {   
    26.   
    27.             avatar = "~/LinkClick.aspx?fileticket=" + user.Profile.Photo;   
    28.   
    29.         }   
    30.   
    31.         else  
    32.   
    33.         {   
    34.   
    35.             avatar = "~/DesktopModules/CuteSoft_Client/CuteChat/Avatars/Messenger/default.png";   
    36.   
    37.         }   
    38.   
    39.         context.Response.Redirect(avatar);   
    40.   
    41.     }   
    42.   
    43.     public bool IsReusable   
    44.   
    45.     {   
    46.   
    47.         get  
    48.   
    49.         {   
    50.   
    51.             return false;   
    52.   
    53.         }   
    54.   
    55.     }   
    56.   
    57. }  

     6.       Ope file “DesktopModules\CuteSoft_Client\CuteChat\NewMessengerMain.htm”

    7.       Find section below

    <img id="ccm_MyAvatar" src="#__cc_urlbase#Images/1x1.gif" class="MessengerAvatar" title="[[UI_ChangePicture]]" onclick="CuteChatMessenger.BubbleCommand('ShowMyInfo',this,event)" />
     
    8.       Change it to(just hide the change avatar function)

    <img id="ccm_MyAvatar" src="#__cc_urlbase#Images/1x1.gif" class="MessengerAvatar" title="[[UI_ChangePicture]]" />
     

    Regards,

    Ken

  •  08-27-2010, 12:04 PM 63697 in reply to 63686

    Re: How to use DNN profile image as users avatar in instant messenger.

    Thank you so much for the response.  Did you get this working in DNN 5.5?
  •  08-27-2010, 4:39 PM 63703 in reply to 63545

    Re: How to use DNN profile image as users avatar in instant messenger.

    Never mind, I was able to get it working.  Thanks again.
View as RSS news feed in XML