添加 免责声明
在ui\controls\days.cs中如下
protected void PostCreated(object sender, RepeaterItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Entry entry = (Entry)e.Item.DataItem;
if(entry != null)
{
HyperLink hl = (HyperLink)e.Item.FindControl("TitleUrl");
if(hl != null)
{
hl.NavigateUrl = entry.TitleUrl;
hl.Text = entry.Title;
}
Literal PostText = (Literal)e.Item.FindControl("PostText");
if(PostText != null&&!CurrentBlog.IsOnlyListTitle)
{
PostText.Text = Framework.Util.Globals.FilterScript(entry.Body);
//陈鹏添加免责声明
PostText.Text = PostText.Text + "<br><br><b> " + Dottext.Framework.Util.Globals.GetWebConfig("CopyRightDescript","版权归作者所有,如有版权问题请与作者联系") + "</b>";
}
Literal desc = (Literal)e.Item.FindControl("PostDescription");
if(desc != null)
{
string link = entry.Link;
}
Literal PostDesc = (Literal)e.Item.FindControl("PostDesc");
if(entry.PostType==PostType.BlogPost)
{
strEditLink=string.Format(UIData.EditPostsLink,CurrentBlog.FullyQualifiedUrl,entry.EntryID);
}
if(entry.PostType==PostType.Article)
{
strEditLink=string.Format(UIData.EditArticleLink,CurrentBlog.FullyQualifiedUrl,entry.EntryID);
}
strFavoriteLink=String.Format(UIData.FavoriteLink,CurrentBlog.FullyQualifiedUrl,entry.EntryID,entry.TitleUrl);
if(PostDesc != null)
{
if(CurrentBlog.EnableComments && entry.AllowComments)
{
PostDesc.Text = string.Format(postdescWithComments,entry.Link,BlogTime.ConvertToBloggerTime(entry.DateCreated,CurrentBlog.TimeZone).ToString("yyyy-MM-dd HH:mm"),entry.Author,entry.Link,entry.FeedBackCount,strEditLink,strFavoriteLink,entry.ViewCount);
}
else
{
PostDesc.Text = string.Format(postdescWithNoComments,entry.Link,BlogTime.ConvertToBloggerTime(entry.DateCreated,CurrentBlog.TimeZone).ToString("yyyy-MM-dd HH:mm"),entry.Author,strEditLink,strFavoriteLink,entry.ViewCount);
}
}
}
}
}
ui\controls\viewpost.cs 中如下
protected override void OnLoad(EventArgs e)
{
base.OnLoad (e);
//Get the entry
Entry entry = Cacher.GetEntryFromRequest(Context,CacheTime.Medium);
//if found
if(entry != null)
{
//Track this entry
EntryTracker.Track(Context,entry.EntryID,CurrentBlog.BlogID);
//Set the page title
Globals.SetTitle(entry.Title,Context);
//Sent entry properties
TitleUrl.Text =entry.Title; //Server.HtmlEncode(entry.Title);
TitleUrl.NavigateUrl = entry.TitleUrl;
Body.Text = Framework.Util.Globals.FilterScript(entry.Body);
//陈鹏添加免责声明
Body.Text = Body.Text + "<br><br><b> " + Dottext.Framework.Util.Globals.GetWebConfig("CopyRightDescript","版权归作者所有,如有版权问题请与作者联系") + "</b>";
strFavoriteLink=String.Format(UIData.FavoriteLink,CurrentBlog.FullyQualifiedUrl,entry.EntryID);
if(entry.PostType==PostType.BlogPost)
{
strEditLink=string.Format(UIData.EditPostsLink,CurrentBlog.FullyQualifiedUrl,entry.EntryID);
}
if(entry.PostType==PostType.Article)
{
strEditLink=string.Format(UIData.EditArticleLink,CurrentBlog.FullyQualifiedUrl,entry.EntryID);
}
PostDescription.Text = string.Format("{0} {1} 阅读({5}) <a href='#Post'>评论({2})</a> {3}{4}",BlogTime.ConvertToBloggerTime(entry.DateCreated,CurrentBlog.TimeZone).ToString("yyyy-MM-dd HH:mm"),entry.Author,entry.FeedBackCount.ToString(),strEditLink,strFavoriteLink,entry.ViewCount);//string.Format("{0} {1}",entry.DateCreated.ToLongDateString(),entry.DateCreated.ToShortTimeString());
//Set Pingback/Trackback
PingBack.Text = TrackHelpers.PingPackTag;
TrackBack.Text = TrackHelpers.TrackBackTag(entry);
}
else
{
//No post? Deleted? Help :)
this.Controls.Clear();
this.Controls.Add(new LiteralControl("<p><strong>The entry could not be found or has been removed</strong></p>"));
}
}