Archive for March, 2006

PsycHo is a WYSIWYG template generator for blogs that supports Blogger. While some of the functionality is annoying to a hand-coder such as myself, this is definately a big step in the right direction for pushing Blogger to non-techies. One of the things that I find odd about it is that by default you must enter your blog title/description manually, instead of using the ones from your Blogger settings. While this can be overcome, the average user won’t necessarily see that.

I would like some more code-structure customisability options for hackers (especially hackers looking to help their non-techy friends). For example, one could not implement hAtom in a PhycHo template if he wanted to (at least so far as I can tell). Other than that (a rather minor point to users anyway) the service seems to provide all the features a normal user would expect, including sidebar(s) cutomisation and linkroll(s) editing. Just one more push to get people away from inferior blogging services like Xanga.

Blogger does not provide a template tag for displaying the profile pictures of commentors in your blog template. Johan Sundström had created a way around this using an IFrame, but I found that solution to be somewhat buggy, even on his own blog. I have modified some of his code and added some of my own to create what I feel is a cleaner hack. I have bundled the majority of the JavaScript into a JScripts entry and it also uses a script I wrote to scrape Blogger profiles to JSON(P) [example]. The code to include the hack into your template is surprisingly simple:

<script type="text/javascript" src="http://jscripts.ning.com/get.php?xn_auth=no&amp;id=830605 </script>
<script type="text/javascript">
//<![CDATA[
addLoadEvent(function(){showCommentPhotos(‘class of elements to put photos in‘,’class of elements where links to authors can be found‘,number of <a> tags before the link to the author (0 if none));});
//]]>
</script>

You will need to add a <div> or other tag (with the class you pass in first) to the comment section, and style it so that the images show up the way you want. The second class you pass is the element containing the link to the comment author, you must add a class to this element if one does not exist. The third parameter is the number of <a> elements in this element before the link to the author. The script runs after page load and should thus have no adverse affects on initial load times.

Back when I started using Ning to create Commentosphere I wrote a review of the service. I have since had much more experience in working with the tools provided by Ning and there have been some improvements and so this is an update on my previous review.

Language Support
To the best of my knowledge Ning still only supports PHP and XNHTML. While they expect to support more languages, for now if you don’t like PHP you won’t like development on Ning. Their PHP support, however, is top-notch. Full PHP5 support with numerous extensions installed and many Ning-specific components that just make coding easier (automated comment system, Gmail support, etc). Having previously only worked with servers supporting PHP4, just the PHP5 support seems like a miracle: code is cleaner and I can use some of those nice OOP features I’ve been reading about for ages.

The Content Store
The content store may still be hard to get into for a coder used to SQL, but once you get your head around it, it can be easier to use in some ways. For example, there are some default fields (title, description, contributorName, createdDate, updatedDate) which, if used correctly, can make transferring code between apps easier. Built-in support for tagging objects means you no longer have to have your code manage (sometimes complicated) many-to-many tables for the relationships between tags and content.

All query filters still behave like an AND operation, but this limitation can often be overcome through code design. While the lack of a union (OR) operation can be painful to get around and would be very welcome, it is not a crucial thing in many apps.

There is still no proper pattern matching, but this too can be partially overcome by storing dummy fields that have appropriate characters (especially non-alphanumerics) replaced by spaces and using their full-text ‘like’ operator. Not the ideal solution, but workable.

The OOP-style of returns still inhibits sorting to some extent, but not nearly as much as I originally feared. SQL-returned arrays are often difficult to merge and sort themselves, and XN_Content objects on Ning are not unsortable, they just require self-written sorting functions. Merging query results is not a common operation anyway.

The Content Store has been significantly speeded up. While mass operations begin to bog, or even freeze, when you deal with volumes approaching 100 objects, at least it is fast enough for some mass-updating operations.

Other Considerations and Conclusions
Multi-user development is still basically impossible on Ning. This is probably the feature #1 on my list of things I wish they’d add. The License problems are annoying (there’s a lot of good GPL code out there I’d like to use) but not fatal.

While Ning has not yet fully rectified my main initial points (speed content store to enable large scale importers, group development, pattern matching, better documentation) I have found that some of these points are mitigated as you get used to the service. While the speed limitation on the content store are annoying, they can be got around if you take data in smaller chunks. The documentation is not the greatest, but it is getting better, especially with the advent of the Ning Tech Blog. Group development is definitely my #1 request at this point.

The list of XOXO Developer’s Resources has been updated to include the Outline Classes. Written in PHP4 but with compatability built in for PHP5 this set of classes is designed to be able to parse and create XOXO, OPML, hAtom, JSON, and arbitrary XML documents and fragments. The classes are GPL‘ed.

JScripts is a new Ning app of mine for hosting JavaScript includes. The benefits of a semi-centralised location for hosting JavaScript APIs/hacks (from the FreshTags system to the prototype framework) are many, but the greatest ones are (1) it makes it easier for us to find ones others have written (2) browsers can then cache the same JavaScript for use across sites. I have put my FreshTags systemon the app, but will also keep it hosted in the other location for now. This blog now includes the file hosted on JScripts, however.

JScripts (and its parent app, FileSS, which I also wrote) has a coComment-integrated comment system and also integrates features from Sweeties. There are RSS feeds for new scripts (which can be filtered by tag, user, and search query) and for comments on each script.