Archive for the ‘PHP’ Category

cms.jellygnite redeveloped using MochaUI

Wednesday, November 5th, 2008

I am currently developing/redesigning my CMS and admin panel I use for clients’ websites. I have found a fantastic tool called MochaUI which was developed using the Mootools javascript framework. MochaUI is a user interface library that you can use to build your web application on.

I had reservations making my CMS completely dependent on MochaUI so I have made everything modular. This will allow me to easily change the user interface should I no longer wish to use MochaUI in the future.

MochaUI provides the ability to open draggable, resizable, rounded-corner and dropshadowed windows without using images. These work great for help and file browser popup windows. It lets you design the user interface using columns and panels which are also resizeable. It uses the canvas tag so everything looks great with customisable curves and dropshadows.

View a screen shot of the CMS initial concept.

Strip non-alphanumeric characters using PHP

Wednesday, October 8th, 2008

You can use regular expressions to achieve this very simply.

function clean_query_string($vsString) {
     return ereg_replace("[^A-Za-z0-9-]", "", $vsString);
}

The regular expression, [^A-Za-z0-9-] tells the function to replace any character that is not (^ means not) any of these characters, A-Za-z0-9-

This would be useful when you need to clean a query string value or the like.