We are currently trying to upgrade to the latest version, but we would like to remove the IP address from the comment post and the new comment notification. Basically we'd like the comments to be completely anonymous should the user want to remain anonymous.
I was able to get to the BlogEngine Core and BlogEngine.NET source code and recompile the DLL to remove the email and IP from the comment post by overriding the AdminLink property
..\Custom\Theme\Standard\CommentView.ascx
string AdminLinks = "";
if (Security.IsAuthorizedTo(Rights.ModerateComments))
{
var sb = new StringBuilder();
//sb.AppendFormat(" | <a class=\"email\" href=\"mailto:{0}\">{0}</a>", this.Comment.Email);
// sb.AppendFormat(
// " | <a href=\"http://www.domaintools.com/go/?service=whois&q={0}/\">{0}</a>",
// this.Comment.IP);
if (this.Comment.Comments.Count > 0)
{
var confirmDelete = string.Format(
CultureInfo.InvariantCulture,
Utils.Translate("areYouSure"),
Utils.Translate("delete").ToLowerInvariant(),
Utils.Translate("theComment"));
sb.AppendFormat(
" | <a href=\"javascript:void(0);\" onclick=\"if (confirm('{1}?')) location.href='?deletecomment={0}'\">{2}</a>",
this.Comment.Id,
confirmDelete,
Utils.Translate("deleteKeepReplies"));
var confirmRepliesDelete = string.Format(
CultureInfo.InvariantCulture,
Utils.Translate("areYouSure"),
Utils.Translate("delete").ToLowerInvariant(),
Utils.Translate("theComment"));
sb.AppendFormat(
" | <a href=\"javascript:void(0);\" onclick=\"if (confirm('{1}?')) location.href='?deletecommentandchildren={0}'\">{2}</a>",
this.Comment.Id,
confirmRepliesDelete,
Utils.Translate("deletePlusReplies"));
}
else
{
var confirmDelete = string.Format(
CultureInfo.InvariantCulture,
Utils.Translate("areYouSure"),
Utils.Translate("delete").ToLowerInvariant(),
Utils.Translate("theComment"));
sb.AppendFormat(
" | <a href=\"javascript:void(0);\" onclick=\"if (confirm('{1}?')) location.href='?deletecomment={0}'\">{2}</a>",
this.Comment.Id,
confirmDelete,
Utils.Translate("delete"));
}
if (!this.Comment.IsApproved)
{
sb.AppendFormat(
" | <a href=\"?approvecomment={0}\">{1}</a>", this.Comment.Id, Utils.Translate("approve"));
}
AdminLinks= sb.ToString();
}
%>
...and remove the IP address from the notification email by modifying the SendCommentMail.cs code by removing:
...\BlogEngine.NET\Custom\Extensions\SendCommentMail.cs
//sb.Append("<br />_______________________________________________________________________________<br />");
//sb.Append("<h3>Author information</h3>");
//sb.Append("<div style=\"font-size:10px;line-height:16px\">");
//sb.AppendFormat("<strong>Name:</strong> {0}<br />", comment.Author);
//sb.AppendFormat("<strong>E-mail:</strong> {0}<br />", comment.Email);
//sb.AppendFormat("<strong>Website:</strong> <a href=\"{0}\">{0}</a><br />", comment.Website);
//if (comment.Country != null)
//{
// sb.AppendFormat("<strong>Country code:</strong> {0}<br />", comment.Country.ToUpperInvariant());
//}
//if (HttpContext.Current != null)
//{
// sb.AppendFormat("<strong>IP address:</strong> {0}<br />", Utils.GetClientIP());
// sb.AppendFormat("<strong>User-agent:</strong> {0}", HttpContext.Current.Request.UserAgent);
//}
//sb.Append("</div>");
However, now the right side panel (Admin, and other sections) do no longer work.
The file '/Custom/Widgets/Administration/widget.cshtml' does not exist.
The file '/Custom/Widgets/Calendar/widget.cshtml' does not exist.
The file '/Custom/Widgets/Tag cloud/widget.cshtml' does not exist.
'/Custom/Widgets/[Widget]/ contains widget.ascx and widget.xml .
How do I fix this?
Thanks