What does my site look like in other browsers?

Good question. Unless your home or workplace happens to be a computer repair store then chances are you have access to only one or maybe two computers. And even then probably only one operating system and one browser (no names mentioned).

BrowserShots is a clever site that takes a screenshot of your site from a bunch of different distributed computers, OS’s and browsers. When I tried it recently it covered 44 different combinations.

The service is slow, but it is free. You can pay a support fee to get access to faster response time. All in all a pretty handy service.

By the way, prepare to be shocked. Your baby may not look as pretty as you think.

Site Down for Maintenance with htaccess

You can use Apache’s rewrite mod in your htaccess file to achieve a simple down for maintenance handler. Some scripts have this built in, some you have to roll your own. This will work with both.

The following htaccess rules will achieve the following:

1. Check the maintenance.html file exists
2. Avoid a loop and or server error by checking that the file being requested is not the maintenance.html file itself
3. Ignore requests from the site developer’s browser (that’s you so you can see the rest of the site)
4. Issue a temporary (302) redirect to everyone else’s browser to fetch the maintenance file instead.

You can modify this behaviour by:

Switching the maintenance mode on or off by renaming or deleting the maintenance file
Adding other IP address rules to permit others (developers, or clients) to view the site
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/path/to/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteCond %{REMOTE_ADDR} !123.123.123.123
RewriteRule ^(.*)$ /path/to/maintenance.html [L,R=302]


You can of course rename the maintenance.html file to anything you please.

How to make iPhone ringtones

Out of the box, iPhones appear to only let you install ringtones purchased from the Apple iStore. For those who don’t want to cough up the dollar or so for a second’s worth of sound byte or just want to do their own thing, here’s how to use Apple’s own tools to do the job for free:

Open a new project in GarageBand.
Drop your sound file into the track pane – it will create a new audio track.
Delete or mute any other tracks that were auto inserted when the new project was created.
Click on the Loop button in the Transport controls at the bottom of the window.
Adjust the loop/cycle length using the gold coloured area at the top of the track ruler.
Menu->Share->Send ringtone to iTunes.
That’s it. It’s cropped, it’s in the right file format, and it’s in your ringtone folder in iTunes. Go ahead and sync to your phone.
Of course you can use whatever tools within Garageband to crop/edit the ring tone before you export it to iTunes.

Remember not to abuse copyright laws and use only your own recordings.

I found out about this functionality just a few months ago. I can’t believe I went for years writing little scripts to pull the data out, manipulate it with string functions, and then post it back in.

Admittedly this is only really useful for simple changes. Most of the time I’ve had to make more detailed changes.

But nevertheless it is useful. In my case, most often when an update to a database doesn’t go quite as expected, leaving odd or rogue results – resulting in whole or part of a string needing to be replaced, or additional text inserted (same thing). This sure beats editing records by hand or knocking up little update scripts.

The usage is similar in a way to the PHP string replace function:

replace(in_Field, old_string, new_string)

An example:

UPDATE myTable
SET myField =
REPLACE (myField, 'oldString', 'newString')
WHERE ...
And you simply change your WHERE clause to suit your own conditions. Or leave it out altogether.

WordPress vs Textpattern vs sNews CMS Review



This has been covered many times by others and yet I have still managed to spend the last 3 or 4 weeks mulling over the pros and cons of each, reading various reviews and comparisons by others and spending a infuriatingly inordinate amount of time installing, un-installing and re-installing all 3 platforms.
Now, at last I ve settled on my platform of choice: Textpattern.

Requirements
I have several pressing web projects at hand:
* retail business requiring static pages, a blog & ecommerce solution
* personal blogs x2
* community magazine requiring multiple authors for article and photo management, multiple layouts management, resources & links management, a simple forum
* corporate site with inbuilt blogging, multi user, user tracking and newsletter management
* large portal site restructure with around 200,000 posts currently being bogged down by a bloated backend

Blogging Tools as Frameworks
Having developed custom solutions based on various larger CMS and portal systems, most of them hacked to the extreme, I was anxious to try a something more lightweight and see how far it could be pushed without having to code a great deal. Additionally I had found, from a coder s perspective, that a common pattern emerged many times: one that would appear to be easily solved by using the blog as a development framework. A million people have eloquently arrived at that solution before me. Maybe I m a bit slow on the take up. Maybe I m a masochist. I m sure most programmers are.

Time
Additionally, and perhaps most importantly, I have a limited amount of spare time. If possible I would prefer to learn one new system well and apply it liberally to cover all my needs; and I m prepared live with the inherent shortcomings of that strategy. (Yikes, I may live to regret that statement)

Pre-selection criteria
The final 3 candidates were pre-selected based on the following criteria:
* Something that runs on LAMP (Linux, Apache, MySQL, PHP). All my development work has been done on this and I feel comfortable there. So the candidates were naturally drawn from the wonderfully deep pool of PHP driven solutions

* Simple to use and administrate
* Aesthetically pleasing nice to look at yes, I don t want to look at any more ugly admin interfaces
* Easy to extend via a sensible plugin architecture or via custom coding
* Open Source: not because it is free ( I did consider Expression Engine at one point) but because I enjoy the speed with which Open Source projects are generally developed
* Robust architecture less time spent chasing bugs that should never have been introduced in the first place
* A mature user community mature in the sense that it has been around a while and hopefully mature in the other sense

The not-so-shortlist
I looked at Joomla, Expresion Engine, Xoops, Serendipity, sNews, Textpattern, WordPress, Drupal, Website Baker.

In order to get all the features I was looking for I would have had to choose one of the bigger systems: more bulk on the server, more load, harder to administrate and occasionally harder for users who are not web savvy to negotiate.

All are exceptional pieces of work and are capable (with a few twists) of fulfilling most web development needs. But a balance had to found between simplicity, beauty and power. It was a matter of finding the sweetspot: some features would have to be custom built or standalone scripts integrated in order to preserve some sanity.

And this is what led to my final selection being made from WordPress, Textpattern and sNews. At one point I did consider using all three over several projects. That would have been a great way to really test them out: but in the end time was the factor that made me make my final choice.

WordPress
Pros:
It used by millions
Simple plug and play for plugins
Admin interface is great
Template installation is simple

Cons:
I found many of the plugins buggy. Not all. Just some. But enough to start really annoying me
The forum appears a bit petty at times and there are a lot of unanswered posts
Complex layouts are possible, but only by working against the normal way of things
Template development appears to be messy

Textpattern
Pros:
Simple plug and play for plugins via cut and paste nice
Flexible layout building via inbuilt tag system
Textile: A Humane Web Text Generator: I really like this. It makes writing easy and generates compliant code that does not break your site
Good forum support
Inbuilt page stats and if you add the db admin plugin then you have direct access to phpMyAdmin features right from the one admin panel. A nice touch for admins
Custom fields. Yay! Developers friends
Inbuilt image & file management

Cons:
Sections versus categories yes it s confusing until you read the manual
Admin panel is almost confusing but isn t really just looks that way. Probably needs revamped. I m sure it s on the to do list for the developers. Might scare non web savvy users a bit though. Will have to wait and see
Template installation is messy. But template development appears to be very logical and powerful thanks to the inbuilt TXP tags system

sNews
Pros:
Simple
Templating is the easiest of them all with this one
Lightweight and fast

Cons:
Simple. More complex sites may be difficult to realise due to having to custom code a flexible layout scheme. It has just released and official multi user version which makes larger sites possible, but it doesn t support the level of access control available in WordPress and Textpattern
No plugin support

Verdict
I really wanted to join the band wagon and choose WordPress. The admin interface is so easy to fall in love with. It has all the cuteness of the Joomla interface but is simple. (Sorry Joomla, lots of eye candy but I don t have enough time to take up a new hobby: Joomla/Mambo administration). But those buggy plugins!

And I really wanted to choose sNews for its simplicity. Often simplicity = power. But it would mean hacking into the core too much. Currently this is how sNews is modded. The reasoning behind it is sound enough. But from my experience, without exception, every time I have seriously altered the core code of an open source application I have found myself unable to upgrade to newer versions. I’ll upgrade once or twice then the thought of plowing through all that commented code to find changes just puts me off and once again I am left with my own development fork.

So, in the end, I chose Textpattern. A compromise. One size fits all. It is a simple elegant solution. A powerful framework design that lends itself to the management of complex layouts and sites through the use of plugins and TXP tags. Much of the design and content management of the sites can be safely handed over to non coders. And in the end I ll hopefully get back some time.