June 2006 - Posts
Today a topic that most of you already might know how to do. How to create a poll in Community Server 2.0. But still, evey now and then the question pops up in the forums. So I thought I'll do a post on it.
Another reason for doing this post, was to examine if I could post screencasts here at weblogs.asp.net in anyway, and also play around with making screencasts in my newly bought SnagIt application (will probably blog about SnagIt in a upcoming post, since it a great tool for screenshots and much more).
I did manage to embed a video in my blogpost here at weblogs.aspnet. I included an OBJECT tag and and an EMBED tag in the HTML of the post, and it worked fine. But the skin I am using cut off the movie in half, probably since it has a fixed width for the posts.
So for the moment I'll have to create a separate HTML page for publishing screencasts.
Watch the Polls in CS screencast (Flash movie).
Watch the Polls in CS screencast (WMV directly in your Mediaplayer).
Today the community of all Community Server MVP's went live. Here you can read about the MVP's, subscribe to a common feed for all the MVP blogs and more.
Jump over to the CSMVPs.com and read more about it.
I believe that the File Galleries that came as a feature built-in in CS 2.0 was a great feature. Now I can offer download area for my users a little bit like download.com. I can also see how many users have downloaded the files, and how many has read it's description. Users can also comment on the file entry as they can for a blog post.
But as with many things currently in CS there's more "under the hood". The feature I am talking about I haven't found in any docs, and I haven't stumbled on it until about a week ago. I am talking about Download Reports for your File Gallery. Besides seeing the number of downloads for a file, you can also see who downloaded it and when. Just go to Control Panel - My Files - Manage Content - Files (for the File Gallery of your choice). If you look at the right of each File entry you should see this:

Press the Download(s) Report button, and you get to choose a date interval, and generate a report.

Click on the image to view a larger version
As you can see, you can also export the report to Excel for archiving or additional calculations.
I sat and read Chris Hammond's blog today, he had a tip on sending mail from DotNetNuke, and I thought: "How do I send mail from a CSModule?". I remember downloading ScottW's CSModule Pack, and that it had a function to send mail when new users were registered etc. Looking through his code I found this (I've translated it from C# to VB):
Dim mail As MailMessage = New MailMessage
mail.To = _adminEmail
mail.Subject = subject
mail.Priority = priority
ail.From = _adminEmail
mail.BodyFormat = MailFormat.Text
mail.Body = body
EmailQueueProvider.Instance().QueueEmail(mail)
Just create a new System.Web.Mail.MailMessage object (if you do it in VS 2005 it will tell you that it's an obsolete class, but it works, and you need to use that since CS expects that class to be sent to the QueueEmail method), fill in the MailMessage's properties, and send it to CS's Email queue.
The _adminEmail, where to get the value for that? Well, you could use the CSContext.Current.SiteSettings.AdminEmailAddress property.
Of course one could always send mail directly via .NET Framework from the CSModule. But implementing CS built-in functions makes it follow the settings you do in the CS Interface and in the config files. Like changing the admin email, re-configuring the email job etc.
Sunday again and I will just post a short one. Just read a great article by Rich Mercher (a CS MVP) on how to extend objects (like users and posts) in Community Server to use more attributes than the built-in. I, like him, has seen this being asked many times in the forums.
Read his article.
You probably already know, if you have a SSL certificate on your web server, that you can run SSL throughout your CS web. There's nothing surprising with that. :-) But did you know that Community Server has built in functions to temporarly redirect your users to use SSL just when they login?
There might not be much needs to run the whole site under SSL if you don't have special reasons for it. It can give some overhead on your server. But it might be a good idea to let your users login via SSL, and then be redirected to non-SSL.
You will find this, as many other good things, in your communityserver.config file. In this case, look in the core section. A snippet from the communityserver.config file says:
ssl (default = Ignore)
Three options:
1. Ignore - CS will use SSL or non-SSL.
2. Password - CS will require (and redirect) to any page which has the user's password
3. All - CS will require all pages (and redirect) use SSL
So if you have enabled SSL at your web server, just change your communtiyserver.config to:
ssl = "Password"
The default setting is 'Ignore'.
Last tuesday I wrote about how to blog by e-mail with Community Server's Email Gateway. I also said that I'll talk about other ways to send mail to your CS blog in an upcoming article. I thought this would be that upcoming article.
I really like the CS Email Gateway, since it besides blog by email, also enables the forums to send and recieve mail. So if you want you could basically use your mail client for all forum conversations. The one problem for me has been that I can't install the Email Gateway at my host. It runs as a console application or as a windows service. So unless I have a dedicated machine, I am out of luck.
But recently I took a closer look at Flickr, having seen it mentioned many times in different contextes. I knew it was a place to upload your pictures, but for that I already had the CS photo galleries. But I noticed they also had a post by email feature. You could email your pictures and they went into your Flickr galleries.
On top of that functionality they also have integration with blogs, and fortunately CS via MetaWeblogAPI. So in my Flickr settings I get the following form to integrate a CS Blog:

I then get options on how I want the blog post to show up in my blog. If there's a picture attached, how should it be sized, where in the post should it show up etc.

The blog then gets its own mailaddress that you can use to post to your CS blog.

The pictures you mail in, will be stored at your Flickr account, and linked to in your blog post. The free account at Flickr lets you upload 20 Mb per month. Works pretty good for me on the sites that I have hosted and can't implement Email Gateway for. The downsides (compared to CS Email Gateay) with the Flickr email to blog functionality that I found is, you can't set the post to not be published when it arrives at your blog, and of course it doesn't handle forums. :-)
As I wrote last tuesday, an email to blog functionality is also great for all of you that want to send pictures and posts from your mobile, when you're away from home on vacation or whatever you do when you're not at home.
Last weekend I said that I would probably not be able to keep up with posting each day, well I lied. :-) Last week I managed to do that again, but I know I won't be able to keep it up for ever. But as long as I am inspired I'll keep on going. Being mentioned each day in CS.org's daily news is one big inspiration, also to see from the statistics that there are a few people reading this blog.
A couple of year's ago I worked as a developer, mostly VB 6, ASP and COM+ applications, but also was on the early .NET train. This was also kind of a hobby for me. Unfortunealty I moved on to another job, where there was no developing at all. So for the last couple of years, there has been very little developing on my part. Just some short periods where I've done some small unfinnished projects on my spare time. And there hasn't been that much inspiration to do any development.
But when I started to read Keyvan Nayyeri's blog and his CS Dev Guide some of my inpiration came back. And the other day, I decided to try to do something from his example of how to write a CSModule. But what should I do with it?
One shortcoming of Community Server in my opinion is that you can't set defaults for some of the user settings for people that register on the site. One specific setting that I have been asking about a couple of times in the forums, is the ability to enable notifications for a new user. It's off by default in CS, and I haven't found anyway to set it to true. I want that to be on by default for my sites, since many users don't find their way in there and enable it. What I didn't want to do is to change the CS source code and recompile. If I did that, I might have to do the same for each new version of CS. In my opinion, it's best to keep off the original source code as long as you can, for your site to be as supportable as possible. So in this case, CSModules are perfect.
So, looking at Keyvan's example I ended up with the following code for enabling notifications for new users:
Imports
System.Xml
Imports CommunityServer.Components
Public
Class MainModule Implements CommunityServer.Components.ICSModule
Public Sub Init(ByVal csa As CSApplication, ByVal node As System.Xml.XmlNode) Implements ICSModule.Init
AddHandler csa.PostUserUpdate, New CSUserEventHandler(AddressOf csa_PostUserUpdate)
End Sub
Private Sub csa_PostUserUpdate(ByVal user As User, ByVal e As CSEventArgs)
If e.State = ObjectState.Create Then
user.EnableThreadTracking = True
End If
End Sub
End
Class
Isn't it beautifully (is that an english word?) simple? :-) Just subscribe to the PostUserUpdate event, check if this is a new user that is created, and set the property.
I had some problems before I got it to work, since I did it with Visual Studio 2005, and had the target web running on ASP .NET 1.1, which I didn't realize at first. Just wandered why it didn't work. :-) I then downloaded the "MSBee" so I could compile it to ASP .NET 1.1, but that was a whole different story on it's own.
Today just a short post, after all it's sunday, isn't it? I was reading Jayson Knight's blog today, and found an article that I would have wanted to have a year ago when I was experimenting with creating skins for CS. It drove me crazy to wait for my changes to go through so I could see the results of my skin changes on the website. And appearently I was too lazy to look for a solution in communityserver.config.
Jayson writes about how to take control of the caching in CS. Go there and have a look, it's great to know also so you can turn off caching on your dev site.
If you're hosting a community where you allow users to have their own photo galleries, you might want to be able to control how much they upload. After all you might not have unlimited disk space, or SQL DB space.
Quotas is a new feature in Community Server 2.0, and as far as I know, currently just available for photo galleries. But hey, that's better than nothing, right?
You can set quotas on photo galleries in two ways. Either you set it on a member role level and/or you set a global quota for everyone.
To set a global quota:
Control Panel -> Administration -> Photos -> Quotas -> Global Quotas Tab

Photo Quota = The number of photos allowed in each gallery
Disk Quota = Amount of disk space allowed for each gallery
To set a role based quota:
Control Panel -> Administration -> Photos -> Quotas -> Owner Role Quotas Tab -> Edit (for the role to set quota on)

If I could have it my way, I would have also liked to have a community wide global quota for a role, which would determine how much space a user in that role could use through out the whole community (photos, attachement, files). And maybe also a File Gallery quota in the same way as the Photo galleries. And while we're at it, why not a forum quota. You might want to give a certain user/moderator his/her own forum, and it would be good to be able to control how much space the attachements takes. Maybe a per blog quota as well? And for all the different quotas, an integrated billing system? Ok, I'll stop now! Just some thoughts from a hoster point of view.
It should be saturday now, and a nice weekend ahead, so who cares about quotas then? ;-)
More Posts
Next page »