BasedGod
  •  BasedGod
  • 56% (Neutral)
  • YAF Forumling Topic Starter
2015-06-01T16:23:31Z
Has anyone figured out a way to enable Avatars on the mobile theme? I'm not sure if it was hardcoded out I do understand the mobile theme uses its own aspx files. I tried to modify the theme file to enable or unhide them to no avail.

Less pertinent question is if anyone has come up with a solution for quick mobile switching?
Sponsor
tha_watcha
2015-06-06T17:39:30Z
Originally Posted by: BasedGod 

Has anyone figured out a way to enable Avatars on the mobile theme? I'm not sure if it was hardcoded out I do understand the mobile theme uses its own aspx files. I tried to modify the theme file to enable or unhide them to no avail.



To add avatars to the mobile pages open up the file ..\themes\YafMobile\MobilePages\displaypost.ascx

and change...

<YAF:OnlineStatusImage id="OnlineStatusImage" runat="server" Visible='<%# PageContext.BoardSettings.ShowUserOnlineStatus && !UserMembershipHelper.IsGuestUser( DataRow["UserID"] )%>' Style="vertical-align: bottom" UserID='<%# DataRow["UserID"] %>'  />
            <YAF:ThemeImage ID="ThemeImgSuspended" ThemePage="ICONS" ThemeTag="USER_SUSPENDED"  UseTitleForEmptyAlt="True" Enabled='<%# DataRow["Suspended"] != DBNull.Value && DataRow["Suspended"].ToType<DateTime>() > DateTime.UtcNow %>' runat="server"></YAF:ThemeImage>
        <YAF:UserLink  ID="UserProfileLink" runat="server" UserID='<%# DataRow["UserID"]%>' ReplaceName='<%#  PageContext.BoardSettings.EnableDisplayName && (!DataRow["IsGuest"].ToType<bool>() || (DataRow["IsGuest"].ToType<bool>() && DataRow["DisplayName"].ToString() == DataRow["UserName"].ToString())) ? DataRow["DisplayName"] : DataRow["UserName"]%>' PostfixText='<%# DataRow["IP"].ToString() == "NNTP" ? this.GetText("EXTERNALUSER") : String.Empty %>' Style='<%#DataRow["Style"]%>' CssClass="UserPopMenuLink" EnableHoverCard="False" />            


to...

<YAF:OnlineStatusImage id="OnlineStatusImage" runat="server" Visible='<%# PageContext.BoardSettings.ShowUserOnlineStatus && !UserMembershipHelper.IsGuestUser( DataRow["UserID"] )%>' Style="vertical-align: bottom" UserID='<%# DataRow["UserID"] %>'  />
            <YAF:ThemeImage ID="ThemeImgSuspended" ThemePage="ICONS" ThemeTag="USER_SUSPENDED"  UseTitleForEmptyAlt="True" Enabled='<%# DataRow["Suspended"] != DBNull.Value && DataRow["Suspended"].ToType<DateTime>() > DateTime.UtcNow %>' runat="server"></YAF:ThemeImage>

<%
            
                 var avatarUrl = this.Get<IAvatars>().GetAvatarUrlForUser(DataRow["UserID"].ToType<int>());

                var avatarTitle = this.GetTextFormatted(
                    "USER_AVATAR",
                    this.HtmlEncode(DataRow[this.Get<YafBoardSettings>().EnableDisplayName ? "DisplayName" : "UserName"].
                        ToString()));
        %>
        <img src="<%=avatarUrl%>" alt="<%= avatarTitle %>" title="<%= avatarTitle %>"
            class="avatarimage img-rounded" />
        <YAF:UserLink  ID="UserProfileLink" runat="server" UserID='<%# DataRow["UserID"]%>' ReplaceName='<%#  PageContext.BoardSettings.EnableDisplayName && (!DataRow["IsGuest"].ToType<bool>() || (DataRow["IsGuest"].ToType<bool>() && DataRow["DisplayName"].ToString() == DataRow["UserName"].ToString())) ? DataRow["DisplayName"] : DataRow["UserName"]%>' PostfixText='<%# DataRow["IP"].ToString() == "NNTP" ? this.GetText("EXTERNALUSER") : String.Empty %>' Style='<%#DataRow["Style"]%>' CssClass="UserPopMenuLink" EnableHoverCard="False" />            




Originally Posted by: BasedGod 


Less pertinent question is if anyone has come up with a solution for quick mobile switching?



There is always a link at the bottom to switch between mobile or full site.

UserPostedImage
BasedGod
  •  BasedGod
  • 56% (Neutral)
  • YAF Forumling Topic Starter
2015-07-08T02:38:44Z
Originally Posted by: tha_watcha 

Originally Posted by: BasedGod 

Has anyone figured out a way to enable Avatars on the mobile theme? I'm not sure if it was hardcoded out I do understand the mobile theme uses its own aspx files. I tried to modify the theme file to enable or unhide them to no avail.



To add avatars to the mobile pages open up the file ..\themes\YafMobile\MobilePages\displaypost.ascx

and change...

<YAF:OnlineStatusImage id="OnlineStatusImage" runat="server" Visible='<%# PageContext.BoardSettings.ShowUserOnlineStatus && !UserMembershipHelper.IsGuestUser( DataRow["UserID"] )%>' Style="vertical-align: bottom" UserID='<%# DataRow["UserID"] %>'  />
            <YAF:ThemeImage ID="ThemeImgSuspended" ThemePage="ICONS" ThemeTag="USER_SUSPENDED"  UseTitleForEmptyAlt="True" Enabled='<%# DataRow["Suspended"] != DBNull.Value && DataRow["Suspended"].ToType<DateTime>() > DateTime.UtcNow %>' runat="server"></YAF:ThemeImage>
        <YAF:UserLink  ID="UserProfileLink" runat="server" UserID='<%# DataRow["UserID"]%>' ReplaceName='<%#  PageContext.BoardSettings.EnableDisplayName && (!DataRow["IsGuest"].ToType<bool>() || (DataRow["IsGuest"].ToType<bool>() && DataRow["DisplayName"].ToString() == DataRow["UserName"].ToString())) ? DataRow["DisplayName"] : DataRow["UserName"]%>' PostfixText='<%# DataRow["IP"].ToString() == "NNTP" ? this.GetText("EXTERNALUSER") : String.Empty %>' Style='<%#DataRow["Style"]%>' CssClass="UserPopMenuLink" EnableHoverCard="False" />            


to...

<YAF:OnlineStatusImage id="OnlineStatusImage" runat="server" Visible='<%# PageContext.BoardSettings.ShowUserOnlineStatus && !UserMembershipHelper.IsGuestUser( DataRow["UserID"] )%>' Style="vertical-align: bottom" UserID='<%# DataRow["UserID"] %>'  />
            <YAF:ThemeImage ID="ThemeImgSuspended" ThemePage="ICONS" ThemeTag="USER_SUSPENDED"  UseTitleForEmptyAlt="True" Enabled='<%# DataRow["Suspended"] != DBNull.Value && DataRow["Suspended"].ToType<DateTime>() > DateTime.UtcNow %>' runat="server"></YAF:ThemeImage>

<%
            
                 var avatarUrl = this.Get<IAvatars>().GetAvatarUrlForUser(DataRow["UserID"].ToType<int>());

                var avatarTitle = this.GetTextFormatted(
                    "USER_AVATAR",
                    this.HtmlEncode(DataRow[this.Get<YafBoardSettings>().EnableDisplayName ? "DisplayName" : "UserName"].
                        ToString()));
        %>
        <img src="<%=avatarUrl%>" alt="<%= avatarTitle %>" title="<%= avatarTitle %>"
            class="avatarimage img-rounded" />
        <YAF:UserLink  ID="UserProfileLink" runat="server" UserID='<%# DataRow["UserID"]%>' ReplaceName='<%#  PageContext.BoardSettings.EnableDisplayName && (!DataRow["IsGuest"].ToType<bool>() || (DataRow["IsGuest"].ToType<bool>() && DataRow["DisplayName"].ToString() == DataRow["UserName"].ToString())) ? DataRow["DisplayName"] : DataRow["UserName"]%>' PostfixText='<%# DataRow["IP"].ToString() == "NNTP" ? this.GetText("EXTERNALUSER") : String.Empty %>' Style='<%#DataRow["Style"]%>' CssClass="UserPopMenuLink" EnableHoverCard="False" />            




Originally Posted by: BasedGod 


Less pertinent question is if anyone has come up with a solution for quick mobile switching?



There is always a link at the bottom to switch between mobile or full site.




That worked like a charm, thank you so much

CHEERS!

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved