Free Opera Registration Codes

Seems like the rumours weren’t quite right. Enter your e-mail address at the Opera website and they’ll give you 7 registration codes – one for each platform they support. Enter this code in Opera and you get it ad-free 🙂

This “special offer” ends at midnight tonight (GMT+1/CET/BST). Asa Dotzler says Opera is 1/365th as free as Firefox 🙂

It would, however, be interesting to see whether these licenses will still be valid when users upgrade to newer versions, how Opera plan to stop people from distributing these codes after the offer ends and what current paying customers will think of this – a waste of $39?

Firefox 1.5 Beta 1 should be released Thursday 8th September.

Bittorrent in Firefox: Beta in 2 weeks

Firepuddle is a project to build support for Bittorrent into Mozilla Firefox as an extension. It is part of Google’s Summer of Code. An alpha release of the extension is due 31st August (this Wednesday) with a Beta due in 2 weeks.

At the moment the extension still lacks .torrent integration with Firefox, only allows one concurrent download and a single tracker connection and doesn’t allow resuming across different sessions. I expect these issues will probably be resolved for the beta or final version.

Star Wars ASCII Movie

Screenshot

This is pretty cool. If you use Windows: Start -> Run -> telnet towel.blinkenlights.nl

Command should be similar in other operating systems. It’s the original Star Wars movie in ASCII. Theres a flash version somewhere at Kontraband too.

RSS 4.0

The RSS Blog releases the specs for RSS 4.0.

In the spirit of introducing at least one new syndication format every day, we at The RSS Blog have decided to release our own version, as promised, of RSS. Introducing RSS 4.0. The spec for RSS 4.0 can be found here. This new format deprecates all RSS 0.9x, RSS 1.1, RSS 3.0 and the other RSS 3.0. Producers of RSS 0.9x, 1.1 and 3.0 must immediately upgrade as their format is here-forth considered obsolete.

So true. At last count, we have RSS 0.9, 0.91 (Netscape), 0.91 (Userland), 0.92, 0.93, 0.94 (kinda), 1.0, 1.1, 2.0, 2.01, 2.01 revision 2 (spec update without version bump), 3.0 and another 3.0. None of these 13 specifications are developed through standards bodies and some are just written for kicks and manage to get published on Slashdot anyway.

Rock on Atom 1.0.

Smarty, BBCode, SafeHTML and Nofollow

Smarty

We currently use the Smarty Template Engine. I chose this over writing a new one because Smarty is powerful, and sufficient for our needs. Ideally I would have been able to use something like Savant with sandboxed PHP but to my knowledge, no template engines use PHP syntax and provide a sandbox. Sandboxing would stop malicious template designers from executing code on the server.

Smarty has some pretty nice syntax and there are quite a few PHP applications which use it so anyone who has used them before should be familiar – if you haven’t, it’s no harder than other templating systems (arguably easier).

BBCode

There are probably hundreds of forum softwares implementing BBCode, each implementing them in slightly different ways. I believe there are many problems with BBCode but people seem to like them after years of muscle memory. For those who like statistics, I gathered the popularity of each markup type from the Evolution Forums. BBCode is still used by around 10% of the community.

Markup Objects Users with Default Markup*
Markdown 43,573 34
BBCode 6,301 58
Plain Text 3,577 34
HTML 2,419 88
Textile 411 6

Note: Markdown is the default content parser. Any users which haven’t set a default markup type in the options page will get Markdown by default. Markdown will therefore be under-represented by these statistics.

I didn’t want to create yet another variant of BBCode. The obvious candidates for inclusion in this software were phpBB’s BBCode Parser and PEAR::HTML_BBCodeParser. I couldn’t find my way around phpBB’s BBCode Parser, so for the moment, we use the PEAR variant. However I’m not too happy with it and on the lookout for an easily reusable BBCode Parser – preferably GPL licensed and not too BB specific. If anyone has any ideas, I’d love to hear them.

SafeHTML

SafeHTML or HTML_Safe is the amazing library I’m using for input filtering. This means the individual markup engines don’t have to check the HTML is safe i.e. by design Markdown allows inline HTML. There is also a setting which allows us to turn on and off SafeHTML for different users, groups, whatever. As an added bonus, it should ensure that tags are nested correctly and does a semi-good job of making it more XHTML-like.

Nofollow

rel=”nofollow” was a Google initative designed to stop spam. There are many problems with nofollow. It is indeed true that bloggers have not noticed a decrease in spam with nofollow and the vast majority of blogging software now automatically marks everything with a nofollow. This great article on nofollow describes how nofollow did nothing to stop spam but actually helped the search engines in reducing “blog noise”.

For these reasons, I am not adding support for nofollow.

Software Upgrade

I’ve made some big changes in the code to remove usernames. Instead, we’ve replaced them with public names. I also added the first bit of XmlHttpRequest-enhanced goodness on the registration page to check whether a public name is taken. You should now be able to login with your e-mail address or your public name. For most of you, this is set to your old username so you won’t notice it. If you had a preferred name before, it hasn’t been changed.

There is a Difference Engine now built into the Revisions. Check it out – make a comment, edit it, and click on the “previous revisions” link. Select two revisions and click on the “Compare selected versions” button. You’ll get a version difference which is semantically marked up with ins and del tags. The “Edit Profile” link has now moved. I’m not sure how logically placed or easy to find it is – we’ll have to see.

I’m not sure if there are any bugs or anything – if you find any, please let me know 🙂 Support for changing passwords and public name is set to come soon. Persistant “Remember me” logins is also another priority.

Searching PHP files with Windows Search

I use the default search engine in Windows XP. It’s not great, but it works. It saves the hassle of deciding whether to use Google, Copernic or MSN and the overhead of having another program installed. It’s also more logical to use – I don’t need to open up my web browser to search the contents of my PHP files.

Windows Search, by default, does not allow you to search PHP. This is because PHP files are a unknown file type. I searched and found the solution.

  1. Click Start, and then click Search (or point to Search, and then click For Files or Folders).
  2. Click Change preferences, and then click With Indexing Service (for faster local searches).
  3. Click Change Indexing Service Settings (Advanced). Note that you do not have to turn on the Index service.
  4. On the toolbar, click Show/Hide Console Tree.
  5. In the left pane, right-click Indexing Service on Local Machine, and then click Properties.
  6. On the Generation tab, click to select the Index files with unknown extensions check box, and then click OK.
  7. Close the Indexing Service console.

Sliders in HTML

Web Forms 2.0 which is set to become part of HTML 5 and is being supported by Opera, Mozilla and Apple will be adding some new HTML input types. One of those is range, which user agents may represent as a slider control.

However, if you can’t wait and want sliders today, it’s been implemented using JavaScript/DHTML. It can be styled pretty well up to the point where it looks like a native widget (see demo). I’m not sure how backwards compatible it is, but it seems like a nice use of Javascript/DHTML and could make form input a lot easier in some cases.

Removing usernames

I’m currently working on removing usernames from the software and using e-mail address as a primary logon. There are several problems I see with usernames. Several thoughts:

  • They are usually lower case and words are often mashed together. Sometimes people stick a number or a country on the end. Sometimes names are separated using underscores or dots (periods). If two people want the username Joe Example, there could be a joeexample, joe_example and joe.example. This can be confusing.
  • Not as friendly as showing proper names. One nice touch of newsgroups is you get an email address of the poster and a “friendly name”. It’s a nice touch for a forum post to say “Joe Example wrote:” rather than “joe.example40uk wrote:”.
  • Most users should theoretically have one e-mail account for all their forums or one account for everything. It should therefore be easy to remember your login name on sites. Certainly I’ve got different variations of the same name at many sites. Usually this is just because someone else has got there first. With e-mail addresses, you can always use the same login name. No one else could have taken that login name.
  • A good login name is not always a good public display name. You may want others to know you as ‘Joe Example’ but when you login you just want to login as joe. Displaying a login name to everyone publically sounds a bit hackish to me.
  • Sometimes users get bored of their username and want to create a new one. At the moment, they’d create a new account. This is not good.

My current plan is to remove usernames. This leaves us with just three columns in the user table – email, password and user_id. That’s almost the bare minimal required for authentication. One of the goals of this software is integration with other software. Someone can write a class for LDAP, Jabber, WordPress, phpBB or whatever. I believe that making sure what no SQL queries join with the user table and removing username would make it much easier to integrate with other authentication systems. Removing the username will be a key part of this.

When users register it’ll ask them for an email address, password and public name. This public name is already part of the profile but will be made a mandatory field. This will be the name which is displayed all over the site – blog comments, profiles, forum posts. To reduce confusion, this public name will be limited (“canonized”). No underscores, no periods, just spaces. No odd mixes of uppercase and lowercase – it’s all lowercase apart from the first letter of each word which is capitalized. Brackets are allowed.

Users can change their public names – probably with a limit of 3 different public names. Once you’ve taken a name, it’s yours forever. Even if you change your public name, no one else can taken it. The 3 name limit is to stop people pointlessly changing their public name every few days. Your old public name is linked to your new one. If someone sends a message to your old public name, it’ll still go to you. If someone tries to view the profile of your old profile name, it’ll show your new one. And there’s no reason why the login form shouldn’t be able to accept your public name as a login.

In short, I’m restructuring the software in such a way to make the login name and publically displayed name different. This will allow users to change public names and allow the software to work with different authentication methods better. It should be a mostly transparent change to the end user. As usual, comments and thoughts welcome!