<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://windowsadvice.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Christian Nordbakk</title><subtitle type="html">Some of this, and some of that...</subtitle><id>http://windowsadvice.com/blogs/cnordbakk/atom.aspx</id><link rel="alternate" type="text/html" href="http://windowsadvice.com/blogs/cnordbakk/default.aspx" /><link rel="self" type="application/atom+xml" href="http://windowsadvice.com/blogs/cnordbakk/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.60809.935">Community Server</generator><updated>2005-03-25T13:05:00Z</updated><entry><title>Find in files and Windows XP</title><link rel="alternate" type="text/html" href="http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx" /><id>http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx</id><published>2005-05-03T16:08:00Z</published><updated>2005-05-03T16:08:00Z</updated><content type="html">&lt;P&gt;I'm so tired of searching for this everytime i need it, so I'll post it here. Hopefully others searching for this too can be helped as well :)&lt;/P&gt;
&lt;P&gt;How to enable content search for unknown filetypes with Windows XPs search functionality: &lt;A href="http://support.microsoft.com/default.aspx?scid=KB;EN-US;q309173"&gt;http://support.microsoft.com/default.aspx?scid=KB;EN-US;q309173&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx&amp;amp;;subject=Find+in+files+and+Windows+XP" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx&amp;amp;;title=Find+in+files+and+Windows+XP" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx&amp;amp;title=Find+in+files+and+Windows+XP" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx&amp;amp;;title=Find+in+files+and+Windows+XP" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx&amp;amp;;title=Find+in+files+and+Windows+XP&amp;amp;;top=1" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/05/03/Find-in-files-and-windows-xp.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://windowsadvice.com/aggbug.aspx?PostID=890" width="1" height="1"&gt;</content><author><name>cnordbakk</name><uri>http://windowsadvice.com/members/cnordbakk.aspx</uri></author><category term="Windows Client" scheme="http://windowsadvice.com/blogs/cnordbakk/archive/tags/Windows+Client/default.aspx" /></entry><entry><title>Filter and Cache Latest Forum Posts</title><link rel="alternate" type="text/html" href="http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx" /><id>http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx</id><published>2005-04-05T16:43:00Z</published><updated>2005-04-05T16:43:00Z</updated><content type="html">&lt;P&gt;One thing you will notice if you use &lt;A href="http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest_Forum_Posts_UserControl.aspx"&gt;my example code for displaying the latest forum posts in a custom UserControl&lt;/A&gt; is that announcements and sticky posts are displayed too, and to make it worst, they are sorted by their sticky date (the date a post is set to un-stick) so that they always appear on top.&lt;/P&gt;
&lt;P&gt;I haven’t found a really good solution to this problem, so if anyone knows one, please let me know. In the meantime I’ve come up with a routine that filters out all announcements and sticky posts, and goes like this:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;int pageSize = 10;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;ThreadSet threadSet = Threads.GetThreads(&lt;BR&gt;&amp;nbsp; -1, &lt;BR&gt;&amp;nbsp; 0, &lt;BR&gt;&amp;nbsp; pageSize, &lt;BR&gt;&amp;nbsp; CSContext.Current.User, &lt;BR&gt;&amp;nbsp; DateTime.MinValue, &lt;BR&gt;&amp;nbsp; SortThreadsBy.LastPost, &lt;BR&gt;&amp;nbsp; SortOrder.Descending, &lt;BR&gt;&amp;nbsp; ThreadStatus.Open, &lt;BR&gt;&amp;nbsp; ThreadUsersFilter.All, &lt;BR&gt;&amp;nbsp; false, &lt;BR&gt;&amp;nbsp; false, &lt;BR&gt;&amp;nbsp; false, &lt;BR&gt;&amp;nbsp; false&lt;BR&gt;&amp;nbsp; );&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;ArrayList forRemoval = new ArrayList();&lt;BR&gt;ArrayList forAddition = new ArrayList();&lt;BR&gt;&amp;nbsp; &lt;BR&gt;// Loop through the set and filter out announcements and sticky posts&lt;BR&gt;foreach (object o in threadSet.Threads)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; Thread t = (Thread) o;&lt;BR&gt;&amp;nbsp; &lt;BR&gt;&amp;nbsp; if (t.IsAnnouncement || t.IsSticky)&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; forRemoval.Add(o);&lt;BR&gt;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // We now need to fetch another thread to substitute&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the one we just removed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (true)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ThreadSet newThreads = Threads.GetThreads(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -1, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pageSize++, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CSContext.Current.User, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime.MinValue, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SortThreadsBy.LastPost, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SortOrder.Descending, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ThreadStatus.Open, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ThreadUsersFilter.All, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; false, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; false, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; false, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; false&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (newThreads.Threads.Count &amp;gt; 0)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread newThread = (Thread) newThreads.Threads[0];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // try again if it's a new announcement or sticky post&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!newThread.IsAnnouncement &amp;amp;&amp;amp; !newThread.IsSticky)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; forAddition.Add(newThread);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;// Remove unwanted posts&lt;BR&gt;foreach (object o in forRemoval)&lt;BR&gt;&amp;nbsp; threadSet.Threads.Remove(o);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;// Add the substitute posts&lt;BR&gt;threadSet.Threads.AddRange(forAddition);&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As you can see this code is neither very aesthetically pleasing to look at, nor very efficient (as opposed to not having to do all this anyway). To counter the overhead created by this I’ve implemented caching of the filtered threads using the mechanisms provided by CommunityServer.&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;string cacheName = "LatestForumPosts-";&lt;BR&gt;if (CSContext.Current.RolesCacheKey == null)&lt;BR&gt;&amp;nbsp; cacheName += "Everyone";&lt;BR&gt;else&lt;BR&gt;&amp;nbsp; cacheName += CSContext.Current.RolesCacheKey;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;ThreadSet threadSet;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;if ((threadSet = (ThreadSet) CSCache.Get(cacheName)) == null)&lt;BR&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;&amp;nbsp; /***************************************&lt;BR&gt;&amp;nbsp;&amp;nbsp; Paste in the first code example here&lt;BR&gt;&amp;nbsp; ****************************************/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=1&gt;&amp;nbsp; // Cache the filtered set&lt;BR&gt;&amp;nbsp; CSCache.Insert(cacheName, threadSet, CSCache.MinuteFactor * 15);&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This mostly counters the overhead brought on by the filter routine, by refreshing the list only once every 15 minutes for each user group. It works, but it just feels wrong, you now…&lt;/P&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx&amp;amp;;subject=Filter+and+Cache+Latest+Forum+Posts" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx&amp;amp;;title=Filter+and+Cache+Latest+Forum+Posts" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx&amp;amp;title=Filter+and+Cache+Latest+Forum+Posts" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx&amp;amp;;title=Filter+and+Cache+Latest+Forum+Posts" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx&amp;amp;;title=Filter+and+Cache+Latest+Forum+Posts&amp;amp;;top=1" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/05/Filter-and-Cache-Latest-Forum-Posts.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://windowsadvice.com/aggbug.aspx?PostID=90" width="1" height="1"&gt;</content><author><name>cnordbakk</name><uri>http://windowsadvice.com/members/cnordbakk.aspx</uri></author><category term="CommunityServer" scheme="http://windowsadvice.com/blogs/cnordbakk/archive/tags/CommunityServer/default.aspx" /></entry><entry><title>Latest blog posts in CommunityServer</title><link rel="alternate" type="text/html" href="http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx" /><id>http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx</id><published>2005-04-04T16:49:00Z</published><updated>2005-04-04T16:49:00Z</updated><content type="html">&lt;P&gt;Just like with &lt;A HREF="/blogs/cnordbakk/archive/2005/03/28/Latest_Forum_Posts_UserControl.aspx"&gt;recent forum posts&lt;/A&gt;, it can be useful to be able to render the latest blog posts on a different page other than the aggregate page. This mini-article will outline the basic steps needed to create a control similar to what is used on the front page on &lt;A href="http://www.windowsadvice.com/"&gt;www.windowsadvice.com&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Again &lt;A href="http://www.aisto.com/roeder/dotnet/"&gt;reflector&lt;/A&gt; (or the CS source) is your friend in figuring out how it all works in CommunityServer internals. In this particular case, all you need is already in use on the blogs aggregate page (CommunityServer.Blogs.Controls.AggregatePostList). The code below is more or less just a copy of what is already found in CS, so no credits to me.&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;STRONG&gt;The needed references:&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face="Courier New" size=2&gt;using CommunityServer.Blogs.Components; // BlogThreadQuery among other things&lt;BR&gt;using CommunityServer.Components; // the ThreadSet object&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;The code:&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;// Contstruct query for getting threads&lt;BR&gt;BlogThreadQuery query = new BlogThreadQuery();&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;query.BlogPostType = BlogPostType.Post;&lt;BR&gt;query.BlogThreadType = BlogThreadType.Recent;&lt;BR&gt;query.IncludeCategories = false;&lt;BR&gt;query.IsPublished = true;&lt;BR&gt;query.PageIndex = 0;&lt;BR&gt;query.PageSize = 10;&lt;BR&gt;query.SortBy = BlogThreadSortBy.MostRecent;&lt;BR&gt;query.SortOrder = SortOrder.Descending;&lt;BR&gt;query.FilterByList = Sections.FilterByAccessControl(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;Weblogs.GetWeblogs(CSContext.Current.User,false,true,false),&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Permission.View);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;ThreadSet ts = WeblogPosts.GetBlogThreads(query,true,true);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;ArrayList threads = ts.Threads;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The threads&amp;nbsp;variable will now contain (up to) the last 10 published posts that the current user has view access to. The ArrayList can be bound to any bindable control, and as always (or, like last time anyway) I’ve provided a simple but working UserControl that you can experiment with yourself. &lt;A href="http://www.anothereon.net/downloads/latestblogposts.zip"&gt;Download it here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Let me know if you have any questions, and I will see if I can’t add another episode to this mini-series :)&lt;BR&gt;&lt;/P&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx&amp;amp;;subject=Latest+blog+posts+in+CommunityServer" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx&amp;amp;;title=Latest+blog+posts+in+CommunityServer" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx&amp;amp;title=Latest+blog+posts+in+CommunityServer" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx&amp;amp;;title=Latest+blog+posts+in+CommunityServer" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx&amp;amp;;title=Latest+blog+posts+in+CommunityServer&amp;amp;;top=1" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/04/04/Latest-Blog-Posts-UserControl.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://windowsadvice.com/aggbug.aspx?PostID=86" width="1" height="1"&gt;</content><author><name>cnordbakk</name><uri>http://windowsadvice.com/members/cnordbakk.aspx</uri></author><category term="CommunityServer" scheme="http://windowsadvice.com/blogs/cnordbakk/archive/tags/CommunityServer/default.aspx" /></entry><entry><title>Latest Forums Posts UserControl in CommunityServer</title><link rel="alternate" type="text/html" href="http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx" /><id>http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx</id><published>2005-03-28T15:55:00Z</published><updated>2005-03-28T15:55:00Z</updated><content type="html">&lt;P&gt;One of the things we wanted for &lt;A href="http://www.windowsadvice.com/"&gt;WindowsAdvice&lt;/A&gt; was for the 10 most recent forum posts to be displayed on the frontpage. &lt;A href="http://www.communityserver.org/"&gt;CommunityServer&lt;/A&gt; doesn’t provide a finished control for this, but does already have the functionality. Here’s a quick post to explain how to find and use this functionality on your own site. I’ve also provided a download to a very basic, but functional &lt;A href="http://www.anothereon.net/downloads/LatestForumPosts.zip"&gt;UserControl for demonstration&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;In the CommunityServer.Discussions assembly, under the CommunityServer.Discussions.Components namespace there is nifty little class named Threads. This class contains a GetThreads method which, when called will return a set of threads that match the criteria’s you supply as parameters.&lt;/P&gt;
&lt;P&gt;I won’t go into much detail on the parameters beyond the method signature which I’ve copied out of &lt;A href="http://www.aisto.com/roeder/dotnet/"&gt;Reflector&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;public static ThreadSet GetThreads(int forumID, int pageIndex, int pageSize, User user, DateTime threadsNewerThan, SortThreadsBy sortBy, SortOrder sortOrder, ThreadStatus threadStatus, ThreadUsersFilter userFilter, bool activeTopics, bool unreadOnly, bool unansweredOnly, bool returnRecordCount);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;A few things about the parameters though are worth mentioning.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;For the forumID parameter you can supply -1 instead of a legit ID. This will cause threads from all forums to be returned. 
&lt;LI&gt;The user parameter, when supplied with an User object of an actual user (e.g. CSContext.Current.User) will filter the issued query so that only threads which the user actually has access to will be returned. 
&lt;LI&gt;ThreadUsersFilter.All will apply no filter, contrary to what it says :)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The GetThreads method returns a ThreadSet object that has a property named Threads on it. This property will return you an ArrayList of Thread objects which you can bind to e.g. a Repeater Control in your UserControl.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.anothereon.net/downloads/LatestForumPosts.zip"&gt;Please see the demonstration UserControl for more details on the binding part.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The cool thing about using the GetThreads method (besides the obvious relief of having to dig through the database schema and procedures to return this result yourself) is that you will get full use of the caching and access control mechanisms that &lt;A href="http://www.communityserver.org/"&gt;CS&lt;/A&gt; provides. No worries about performance or security :)&lt;/P&gt;
&lt;P&gt;I was thinking about writing a longer article on this topic, so please let me know if that would be interesting, and what specifically you would want to know.&lt;BR&gt;&lt;/P&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx&amp;amp;;subject=Latest+Forums+Posts+UserControl+in+CommunityServer" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx&amp;amp;;title=Latest+Forums+Posts+UserControl+in+CommunityServer" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx&amp;amp;title=Latest+Forums+Posts+UserControl+in+CommunityServer" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx&amp;amp;;title=Latest+Forums+Posts+UserControl+in+CommunityServer" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx&amp;amp;;title=Latest+Forums+Posts+UserControl+in+CommunityServer&amp;amp;;top=1" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/28/Latest-Forum-Posts-UserControl.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://windowsadvice.com/aggbug.aspx?PostID=53" width="1" height="1"&gt;</content><author><name>cnordbakk</name><uri>http://windowsadvice.com/members/cnordbakk.aspx</uri></author><category term="CommunityServer" scheme="http://windowsadvice.com/blogs/cnordbakk/archive/tags/CommunityServer/default.aspx" /></entry><entry><title>Useful registry settings</title><link rel="alternate" type="text/html" href="http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx" /><id>http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx</id><published>2005-03-25T11:05:00Z</published><updated>2005-03-25T11:05:00Z</updated><content type="html">&lt;P&gt;I tend to make quite a few changes to a clean install of Windows to make things a bit tidier and run smoother. Below are a list of some of&amp;nbsp;my most belowed registry hacks / settings and scripts, some of which I hope can be useful&amp;nbsp;to you too:&lt;/P&gt;
&lt;P style="COLOR: #ff0000"&gt;Disclaimer:&lt;BR&gt;The files are located at my private site (&lt;A href="http://www.anothereon.net"&gt;http://www.anothereon.net&lt;/A&gt;), and are as such under my control. I do not, however, give any guarantees with these&amp;nbsp;hacks.&amp;nbsp;If you do not fully understand what implications changes to the registry can impose on your system, are not able to understand the details of what these hacks do, or you aren't prepared to scrap you system if they should mess things up &lt;STRONG&gt;THEN DO NOT DOWNLOAD ANY OF THESE FILES&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;[Registry settings]&lt;BR&gt;&lt;STRONG&gt;TaskbarIconsOnly&lt;/STRONG&gt; - Sizes the taskbar items so that only the icon is visible. I don't like the auto grouping function in XP very much, so this setting allows me to fit a lot more windows in there without clutter.&lt;BR&gt;&lt;STRONG&gt;OpenAllFoldersAsExplorer&lt;/STRONG&gt; - This hack will force all windows you open to display the explorer bar at the left side of the window. I find this one particularly useful since I don't always use the Windows+E shortcut to launce new windows (ThinkPad anyone?).&lt;BR&gt;&lt;STRONG&gt;CmdToRightClick&lt;/STRONG&gt; - Very, very useful, since it inserts a "Cmd from Here" item in the context menu when you right-click a folder. Saves you from having to CD to that folder.&lt;BR&gt;&lt;STRONG&gt;DisableBaloonTips&lt;/STRONG&gt; - Disables the most annoying baloon tips (all baloon tips are annoying baloon tips, right? )&amp;nbsp;from popping up on the task bar at all times.&lt;BR&gt;&lt;STRONG&gt;CmdQuickEdit&lt;/STRONG&gt; - Enables shortcuts in the command prompt.&lt;BR&gt;&lt;STRONG&gt;VSNet2003CmdHere&lt;/STRONG&gt; - The same as CmdToRightClick but lets you launch a cmd prompt with VisualStudio 2003 variables loaded.&lt;/P&gt;
&lt;P&gt;[Scripts]&lt;BR&gt;&lt;STRONG&gt;RemoveWindowsMessenger&lt;/STRONG&gt; - Completely removes Windows Messenger from you XP installation.&lt;BR&gt;&lt;STRONG&gt;DisableAVIScan&lt;/STRONG&gt; - Prevents Windows from searching AVI files for meta information, something that causes the CPU to pike at a 100% for a long time just by highlighting such a file in explorer.&lt;/P&gt;
&lt;P&gt;The files are all packaged into one archive and can be downloaded here: &lt;A href="http://www.anothereon.net/Downloads/XPTweaks.zip"&gt;http://www.anothereon.net/Downloads/XPTweaks.zip&lt;/A&gt;&lt;BR&gt;&lt;/P&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx&amp;amp;;subject=Useful+registry+settings" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx&amp;amp;;title=Useful+registry+settings" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx"&gt;bookmark it!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx&amp;amp;title=Useful+registry+settings" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx&amp;amp;;title=Useful+registry+settings" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx&amp;amp;;title=Useful+registry+settings&amp;amp;;top=1" target="_blank" title = "Post http://windowsadvice.com/blogs/cnordbakk/archive/2005/03/25/Useful-Hacks-1.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://windowsadvice.com/aggbug.aspx?PostID=52" width="1" height="1"&gt;</content><author><name>cnordbakk</name><uri>http://windowsadvice.com/members/cnordbakk.aspx</uri></author><category term="Useful tools" scheme="http://windowsadvice.com/blogs/cnordbakk/archive/tags/Useful+tools/default.aspx" /></entry></feed>