cschear
  •  cschear
  • 61.4% (Friendly)
  • YAF Camper Topic Starter
2011-03-09T15:58:53Z
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\printtopic.ascx.cx 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(ForumPages.search, "postedby={0}",   displayName);//this.PostData.UserProfile.UserName);
          break;


Obviously you would want to switch based on the display name setting - but it is always on for our setup.
Sponsor
cschear
  •  cschear
  • 61.4% (Friendly)
  • YAF Camper Topic Starter
2011-03-09T17:13:09Z
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}"] =
            "{0}\r\n\r\n".FormatWith(
              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 =
            this.Get<ILocalization>().GetText(
              "COMMON", "PM_NOTIFICATION_SUBJECT", UserHelper.GetUserLanguageFile(toUserId)).FormatWith(
                displayName, //YafContext.Current.PageUserName, 
                YafContext.Current.BoardSettings.Name, subject);
bbobb
  •  bbobb
  • 100% (Exalted)
  • YAF Developer
2011-03-11T14:18:10Z
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