Different icons for each chat room

Last post 03-10-2008, 9:13 AM by murryc. 8 replies.
Sort Posts: Previous Next
  •  02-18-2008, 12:03 PM 37121

    Different icons for each chat room

    Working with Chat/Messenger on Community Server 2007.
    On the main chat page where all my rooms are listed, I would like to have a different icon picture for each room.  As it stands, the same icon on each room makes it hard to tell the difference between the chat rooms.
  •  02-18-2008, 12:22 PM 37122 in reply to 37121

    Re: Different icons for each chat room

    murryc,
     
    You can achieve this feature programmatically.
     
    Each room has an unique LobbyId.
     
    So you need to change:
     
     <nobr><asp:Image ImageUrl="~/CuteSoft_client/CuteChat/Images/50-home.gif" align="center" runat="server" id="Image1" />
      <%#DataBinder.Eval(Container.DataItem, "Name")%></nobr>
                
    to:
     
     <nobr><img src="http://cutesoft.net/MyImages/<%#DataBinder.Eval(Container.DataItem, "LobbyId")%>.gif">
      <%#DataBinder.Eval(Container.DataItem, "Name")%></nobr>
     
    Then rename your image accordingly.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  02-18-2008, 1:22 PM 37124 in reply to 37122

    Re: Different icons for each chat room

    Adam,
     
    can you please show me the right way to add the LobbyID. I tried 
     
    <%#DataBinder.Eval(Container.DataItem, "LobbyId=1")%>
    <%#DataBinder.Eval(Container.DataItem, "LobbyId1")%>
    <%#DataBinder.Eval(Container.DataItem, "LobbyId=-1")%>
      and so on.  i just get an error telling me there is no resource for lobbyid1 or something along those lines if i change it from "LobbyID"..
     
    Thanks, Jay
  •  02-19-2008, 1:14 AM 37140 in reply to 37124

    Re: Different icons for each chat room

    Jay,
     
    Please use the following code:
     
    <%#DataBinder.Eval(Container.DataItem, "Lobby.LobbyId")%>

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  02-19-2008, 1:13 PM 37165 in reply to 37140

    Re: Different icons for each chat room

    Adam,
     
    Thanks for the reply. I gave the new code a try from your last post. I still seem to get this error when i change anything in the DataItem list. System.Web.HttpException: DataBinding: 'CuteChat.AppLobby' does not contain a property with the name '...'
     
    We have 6 rooms that we use so there ID's are 1 - 6. So lobbyID 1 is named General Radio Chat   LobbyID 2 is named General Television Chat    LobbyID 3 is named Public Conference Room #1   and so on.
     
    If you have time using this code can you show me what the completed example should look like with my LobbyID's and room names.
    <nobr><img src="http://cutesoft.net/community/Chat/Images/<%#DataBinder.Eval(Container.DataItem, "lobby.LobbyId")%>chat_home.jpg"><%#DataBinder.Eval(Container.DataItem, "Name")%></nobr>
     
    On  a side note would it be possible to add a new table in the DataBase for an image then add this as an option in the admin control panel for each lobby created.  Basicly just what we are doing now but make it an option in the chat admin control panel.
     
    Thanks, Jay
  •  02-21-2008, 10:48 PM 37267 in reply to 37165

    Re: Different icons for each chat room

    Adam...GOTBUD has been a big help to me in trying to get this accomplished.  I appreciate all your help and both of us feel we are really close to getting this done.  Any chance you could shed some light on GOTBUD's latest post?  I think he is on the right track and has much more experience with your software than I.  Any help is greatly appreciated.
     
    Thanks,
    murryc
  •  02-29-2008, 3:59 AM 37462 in reply to 37267

    Re: Different icons for each chat room

    You can achieve this feature programmatically.
     
    Each room has an unique LobbyId.
     
    So you need to change:
     
     <nobr><asp:Image ImageUrl="~/CuteSoft_client/CuteChat/Images/50-home.gif" align="center" runat="server" id="Image1" />
      <%#DataBinder.Eval(Container.DataItem, "Name")%></nobr>
                
    to:
     
    <nobr><img src="http://cutesoft.net/MyImages/<%#DataBinder.Eval(Container.DataItem, "Lobby.LobbyId")%>.gif">
      <%#DataBinder.Eval(Container.DataItem, "Name")%></nobr> </nobr>
     
    Then rename your image accordingly.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-07-2008, 12:32 PM 37684 in reply to 37462

    Re: Different icons for each chat room

    Adam,
     
    I just wanted to thank you for taking the time out to help us with this. Murry and I are far from programmers and sometimes we are challenged with the simple things.
     
    I would also like to add one other way we found that worked. I placed this at the end of:

    LobbyInfo lobby = (LobbyInfo)e.Item.DataItem;

    Image image = e.Item.FindControl("Image1") as Image;

    image.ImageUrl = "/community/chat/images/" + lobby.Lobby.LobbyId.ToString() + ".jpg";
     
    Then like Adam said Then rename your image accordingly. like 1.jpg 2.jpg for the lobbyid you have..  That was the part i did not understand.
     
    Thanks Again, Jay
  •  03-10-2008, 9:13 AM 37712 in reply to 37684

    Re: Different icons for each chat room

    Thanks for the help Adam!
     
    -Murry
View as RSS news feed in XML