August 2008 - Posts

I'm currently working on threaded comment systems. Comment threads allow you to reply to a comment. This is a feature that the users are clamoring for on Vloggerheads because it is a popular feature on YouTube .  Even the trolls are wondering when we are going to have this feature. One of the more amusing aspects of this project is the ongoing video commentary from the peanut gallery. It is like having Bill O'Reilly doing vicious news reports about the progress, or lack of progress, of your project.

There are surprisingly few examples of threaded comment systems. I can't think of any good examples. Let me know of any open source web applications that have this feature. WordPress does not allow replies to blog comments. Community Server also does not have this feature.

The Ning platform is proving to be a bad choice for building a social networking site. Recently there was a huge controversy over their decision to ban Widget Laboratory, an independent software company that provided many widgets for Ning Network Creators. There have been many articles about this on TechCrunch so the whole blogosphere is abuzz about this nasty public fight. You can read about it at: Ning Shuts Down Premium Developer WidgetLaboratory.  I think Vloggerheads was using widgets from WidgetLaboratory and planned to have them develop a few features. For two days Ning even suspended my SFTP and WebDav access to my site's file system so I was unable to continue my work. So I'm really not happy with the capricious control Ning has over this project.

I've been exploring various options for creating a social networking site for vlogging. Unfortunately there are web applications for video sharing sites and web applications for social networks but nothing that combines the two. Currently I'm considering PHPMotion for the video sharing side of things and Elgg for the social networking groundwork. They are both open source web applications based on PHP, MySQL, and Apache. So you may be wondering why I don't consider something based on ASP.NET, my area of expertise.

I think the primary reason for not going with ASP.NET is the lack of open source web applications based on ASP.NET. The only thing we have is DotNetNuke. DotNetNuke is a content management system and I doubt that it can be customized to have both social networking and video sharing features. However, the PHP community has a wealth of open source web applications; WordPress, Joomla, Elgg, PHPMotion, CakePHP, MediaWiki, OsCommerce, etc. Although I would be sacrificing my experience, I gain a considerable amount of groundwork if I lean towards PHP, MySQL, and Apache. ASP.NET really needs a lot more sophisticated open source web applications and frameworks to compete with the LAMP stack.

At the moment, I am translating my VB.NET code for comment threads into PHP so I can use it on Ning or Elgg or PHPMotion. This is proving to be very time consuming and difficult but not impossible because PHP has DOM classes for XML manipulation which closely correspond  to .NET's XmlDocument class. I need to reorganize the comments into a hierarchy that reflects the comment thread. This can then be applied to nested ordered list HTML tags. XML is a good choice for the necessary hierarchy although other options would be sorted arrays, XSL using JavaScript, pure JavaScript to manipulate the DOM, or directly sorting and ordering database records. 

I've finally gotten around to using something from the AJAX Control Toolkit in an actual project. My client was dissatisfied with the <asp:calendar> control so I offered to AJAX enable the site and replace it with the fancier Calendar control from the ASP.NET AJAX Control Toolkit. Naturally the client found something he wanted to work a little different. This calendar control was for entering your birth date and he did not want the user to scroll back decades to find that date. He wanted the calendar to show up with the 1990-1999 decade already visible so the user could start from there. Fortunately I remembered that the ASP.NET AJAX Control Toolkit comes with all the source code so you can customize it to suite your needs.

This requirement was extremely easy to implement. All you really need to do is set the calendar mode to "years" when you first show it. However there was no property for initial mode so I had to create one. This was virtually a cut and paste hack because there are existing properties to base it on.

1. Open CalendarExtender.cs and create a new ExtenderControlProperty:

   1: [DefaultValue("")]
   2: [ExtenderControlProperty]
   3: [ClientPropertyName("initialMode")]
   4: public virtual string InitialMode
   5: {
   6:    get { return GetPropertyValue("InitialMode", string.Empty); }
   7:    set { SetPropertyValue("InitialMode", value); }
   8: }

2. Open CalendarBehavior.js and create a new member:

   1: this._initialMode = null;

3. Also in CalendarBehavior.js add new get and set functions for the property access:

   1: get_initialMode : function() { 
   2:     /// <value type="String">
   3:     /// The initial mode of the calendar
   4:     /// </value>
   5:  
   6:     return this._initialMode; 
   7: },
   8: set_initialMode : function(value) { 
   9:     if (this._initialMode != value) {
  10:         this._initialMode = value; 
  11:         this.raisePropertyChanged("initialMode");
  12:     }
  13: }, 

4. And finally set the _switchMode in the show : function() with this new line of code:

   1: this._switchMode(this._initialMode, true);

Compile the AjaxControlToolkit project and copy the AjaxControlToolkit.dll file to your bin directory. Now you can use your new property in the Calendar control like so:

   1: <ajaxToolkit:CalendarExtender ID="calendarButtonExtender" runat="server" TargetControlID="Date5" 
   2:             PopupButtonID="Image1" InitialMode="years" />
Calendar-Years-Mode[4]

I'm finally working on a project with the potential to be a really high profile web site. I've offered my services as a volunteer programmer to the http://www.vloggerheads.com web site which is being built on the Ning social networking platform. This site is an attempt by prominent vloggers from YouTube and LiveVideo to take control of their community.

Vloggers have been plagued by trolls, hackers, haters, and cyberbullies who are allowed to run amuck on the video sharing sites. This has been a major problem for a very long time and the sites where people vlog have ignored the frequent complaints from their users. Vloggers feel unappreciated. They don't think the video sharing sites are interested in creating a safe environment for the community. I've been outraged over the shoddy customer service and total indifference to the user base for quite some time. YouTube is like a convenience store in a bad section of town where the business owner allows hoodlums to lounge outside the store and harass its customers. The hoodlums are even allowed inside the store to give the customers grief as they shop and a hoodlum may even become customer of the month. Trolls have been featured on YouTube!

This has led to a revolt among the user base. It is an inspiring example of the collaboration that social networking is said to foster. Vloggers have come together to plan their own video sharing site that will provide a safe environment to do what they love to do. Personally, if I was managing a web site and my user base left en masse to form their own site out of disgust with how I was running things, I would feel professionally mortified.

The Ning social networking platform is surprisingly customizable. They provide more than the usual XML and JSON data feeds as an API. You can actually script your site in PHP. They don't use a proper database though. You have to add custom developer attributes to a set number of content objects to extend their data schema. Ning rolled their own Model View Controller framework. My brief study of CakePHP was useful in understanding this architecture but I still need to brush up on my PHP. Ning also uses the Dojo JavaScript toolkit which is worth studying. So far I have learned enough on this project to make it well worth my time.

As far as ASP.NET goes, the only interesting aspect to the project so far has been using PHP as a SOAP client to an ASP.NET web service. This proved to be tricky because you must specify the data type of the parameters in PHP and send them as an associative array.

Although the Ning site has energized the community by providing it with a sense of ownership and control, there is still an awareness that basing the site on Ning could be limiting. Nobody wants to be at the mercy of another indifferent social networking site that will not enforce its terms of service. I've already recommended http://www.codeplex.com/videoshow as a potential vlogger platform but it lacks any social networking features and I don't relish the prospect of building that from scratch.

More Posts