Community Server2.0のBlogにトラックバックURLを表示するようにSkinを修正してみました。
適当に作ってテストもしてませんが。
実運用でテストと言うことで(^^;
ひょっとして同じような事やってる人いるのかなぁ。
対象はSkin-EntryView.ascxです。
private string GetTrackBackUrl() {
string strResult = string.Empty;
CSContext csContext = CSContext.Current;
BlogThreadQuery query = new BlogThreadQuery();
query.PostID = csContext.PostID;
string name = Context.Request.QueryString["PostName"];
if(!Globals.IsNullorEmpty(name))
query.PostName = name;
query.IncludeCategories = true;
query.ReturnFullThread = true;
query.SectionID = Weblogs.GetWeblog(CSContext.Current.ApplicationKey).SectionID;
PostSet ps = WeblogPosts.GetPosts(query,true);
if(ps != null)
{
WeblogPost we = ps.ThreadStarter as WeblogPost;
strResult = "この記事へのTrackBack URL<br/>" + Globals.HostPath(Context.Request.Url) + BlogUrls.Instance().TrackbackPingUrl(we.PostID);
}
return strResult;
}
void Page_Load(object sender, System.EventArgs e)
{
TrackBack.Text = GetTrackBackUrl();
}