Contact Lifestream
        

Lifestream: Upgraded to Wordpress 2.5. Better late than never.




Site: Nucleus Comment Form Modification

I got really bored with the standard Nucleus comment form. Basically it’s been there since I activated comments with minor CSS modifications. There are a number of shortcomings, beyond the actual CSS and layout, which I also aim to correct.

  • Formatting of text input, bold, italic etc. There is a plugin to this end I believe. Looking into it. COMPLETED.
  • Avatar support. Using the Gravatar plugin and supplying a generic avatar for those that can’t be bothered with Gravatars. Don’t know what kind of impact the service has had yet. I’ve registered but never used it, or rather not found many sites that actually use it. Looking into it. COMPLETED.
  • Additional field, HTTP. Mostly due to the Gravatar plugin, and tidiness, it’s not such a good idea to have just one field (the generic ‘userid’) where the user can enter either his email or HTTP. So what I should do is modify the core Nucleus files to accept, store and fetch an additional field, ‘userweb’. COMPLETED.
  • Looking at practical ways to show comments in brief or whole below items on the main page or to show a quick comment form, possibly with a javascript toggle switch feature. Still looking …

08/01: Right, so the new comment form is now in place. Not only can you now enter email as well as homepage (core hack), see your Gravatar (plugin), use a limited set of formatting tags (plugin) but there is also a small box that informs you what the commenting code can and cannot do. I also hacked the core files further to allow members to add any number of characters (default limit is still 5000). Oh, and I added a javascript button to make a quick word and character count.

The word count script was nabbed from Javascript Source. And the ‘insert at cursor’ javascript came from Alex King. As did the JS Quicktags which also uses the same insert technique. The improved FancyText Nucleus plugin is made by Radek Hulan (blog).

The amount of extra code is around 10kb (which I guess will gzip to nothing) so the extra loading time should be insignificant. When I started out I first tried to implement textarea replacements like TinyMCE and HTMLArea. But after using them extensively in Mambo I know how slow they are to load and they contain a lot of code that one can’t use anyway since Nucleus can’t parse HTML tags in the comments (by design). Editing that out would open the comments up to all kinds of abuse. And besides, how many visitors will feel compelled to make ‘designer comments’? I think that the occasional bold or italic text will do the trick. Even TinyMCE is almost 100kb and the replacement function can be kind of buggy if you have a really slow connection.