You may have noticed that over the past few weeks I have been trying to build more interactive elements into this blog, some of these include.
- Most viewed posts webpart.
- Rate a post.
- Highest Rated posts webpart.
- Concurrent user indicator.
- MSN client, online / offline status.
- Sessions per hour graph.
My intention was that this blog would start to expose more of the interesting content and create a slight online presence awareness by subtly reacting to how it is interacted with.
Most of the features I just listed are part of a Sqlite stats database that I’ve been logging certain sessions/hits/ratings to. I hope to make this available in the near future with a slightly improved version of the Sqlite datalayer.
But for now here is how to install the code I am using to control the MSN client and a preview of the Concurrent user indicator.
How to install this webpart.
Step 1: Create yourself a new ‘bot’ msn account that your website will use, than add yourself to the bot’s contact list.
Step 2: Add these 2 events to your Global.asax fileprotected void Session_OnStart()
if (kowitz.SingleUserBlog.Services.SqliteBlogStatRecorder.ConcurrentUsers() <= 0)
Step 3: Copy the webpart control into the Webparts folder. Copy the images into your images directory and copy the two dlls (kowitz.WebsiteMSN.dll and XihSolutions.DotMSN.dll) into your Bin directory.
Step 4: Add the webpart to your Masterpage’s catalogue zone.<uc1:MessengerOnlinePresenceID="MessengerOnlinePresence1"Title="Messenger Online Presence"runat="server"/>
Step 5: Add this to your BlogConfiguration.xml file:<MyMSNAccount> [email protected] </MyMSNAccount>
<BotMSNAccount> [email protected]</BotMSNAccount>
Step 6, Allowing your bot to message you when someone leaves feedback:
Add this line to the
void CommentForm1_CommentAdded() function
(just after the call to "Notifications.NotifyAdministrator(subject,
body);") in your Posts.aspx page.
Your blog should now be logging onto MSN when there is at least 1 active session on your site.
As I mentioned before, a lot more of the things I’ve added are part of the Sqlite stats db / blog datalayer I’ve been making and hopefully I’ll also be releasing this soon.