•  cschear
  • 61.4% (Friendly)
  • YAF Camper Topic Starter
The username is showing in a few places when using display name. I made the following changes to stop it from showing (sorry haven't figured out how to do a patch yet).

In pages\ Line# 89

    protected string GetPrintHeader([NotNull] object o)
        var row = (DataRow)o;
        string displayName = this.PageContext.Get<IUserDisplayName>().GetName((int)row["UserID"]);
        return "<strong>{2}: {0}</strong> - {1}".FormatWith(
          displayName, this.Get<IDateTime>().FormatDateTime((DateTime)row["Posted"]), this.GetText("postedby"));

In controls\DisplayPost.ascx.cs Line# 478

        case "lastposts":
          string displayName = this.PageContext.Get<IUserDisplayName>().GetName(this.PostData.UserId);
          YafBuildLink.Redirect(, "postedby={0}",   displayName);//this.PostData.UserProfile.UserName);

Obviously you would want to switch based on the display name setting - but it is always on for our setup.
  •  cschear
  • 61.4% (Friendly)
  • YAF Camper Topic Starter
Also showing in PM's

In YAF.Core\Services\YafSendNotification.cs Line# 183

          string displayName = YafContext.Current.Get<IUserDisplayName>().GetName(YafContext.Current.PageUserID);

          // fill the template with relevant info
          notificationTemplate.TemplateParams["{fromuser}"] = displayName; //YafContext.Current.PageUserName;
          notificationTemplate.TemplateParams["{link}"] =
              YafBuildLink.GetLinkNotEscaped(ForumPages.cp_message, true, "pm={0}", userPMessageId));
          notificationTemplate.TemplateParams["{forumname}"] = YafContext.Current.BoardSettings.Name;
          notificationTemplate.TemplateParams["{subject}"] = subject;

          // create notification email subject          
          string emailSubject =
              "COMMON", "PM_NOTIFICATION_SUBJECT", UserHelper.GetUserLanguageFile(toUserId)).FormatWith(
                displayName, //YafContext.Current.PageUserName, 
                YafContext.Current.BoardSettings.Name, subject);
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
Applied your fixes (a bit changed), except the subject localization in the last chunk.

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