The Showthread.aspx contains a slight bug as well. If you get a thread with more than 1 page worth of posts, the title (Thread: {0}) will *not* be updated, due to the title only being set in case of NOT a postback.
I did a very quick and very dirty solution:
protected void Page_Load(object sender, EventArgs e)
{
threadPostID = int.Parse(this.Request.QueryString["ID"]);
if (!this.IsPostBack)
{
threadPostID = int.Parse(this.Request.QueryString["ID"]);
Post post = Post.GetPostByID(threadPostID);
this.Title = string.Format(this.Title, post.Title); post.IncrementViewCount();
lblPageTitle.Text = string.Format(lblPageTitle.Text, post.ForumID, post.ForumTitle, post.Title);
ShowCommandButtons(post.Closed, post.ForumID, threadPostID, post.AddedBy);
}
became
protected void Page_Load(object sender, EventArgs e)
{
threadPostID = int.Parse(this.Request.QueryString["ID"]);
if (!this.IsPostBack)
{
threadPostID = int.Parse(this.Request.QueryString["ID"]);
Post post = Post.GetPostByID(threadPostID);
post.IncrementViewCount();
lblPageTitle.Text = string.Format(lblPageTitle.Text, post.ForumID, post.ForumTitle, post.Title);
ShowCommandButtons(post.Closed, post.ForumID, threadPostID, post.AddedBy);
}
try
{
Post post = Post.GetPostByID(threadPostID);
this.Title = string.Format(this.Title, post.Title);
}
catch { }
}
http://entropia-online.blogspot.com/