15
Jan 10

Select and Unselect All Checkboxes with jQuery

I’ve been working with jQuery to spice up my interfaces for over 12 months now and figured it’s time to share some of the little techniques I’ve developed on the way.

The first is something I use quite alot when I am giving users the ability to administer lists of items in bulk. That including a checkbox that when checked sets the state of all the checkboxes beside a list of items to “checked”. Naturally unchecking it will uncheck all checkboxes. I’m sure you get the picture here’s the code based on two scenarios depending on your preference. But firstly you need to include the jQuery library in the head of your document (I grab mine straight from Google’s repository to save my bandwidth):

Continue reading →

  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • StumbleUpon
  • LinkedIn
  • Reddit
  • Netvibes
  • email

27
Nov 09

A workaround for the CakePHP alphaNumeric issue

Recently whilst building a CakePHP app on a shiny new server I noticed some unexpected behaviour when using an alphaNumeric rule to validate a model. Whatever I passed into the model returned false. That is to say that even a valid alphanumeric string threw up an exception. (if you haven’t already dived into CakePHP, you should – it’s a rapid development framework based on MVC.)

The issue seems to be tied to PHP 5.1.2 and the way regular expressions are handled, however it seems the it may appear in other configurations too. Before I get to a workaround, note I haven’t levelled the “bug” word at either PHP nor CakePHP – for all I know it could be a difference of opinion on how something should be handled. What I do know is that I would rather harness CakePHP’s flexibility to create custom model rules than try upgrading my current live server PHP installation.

Here is an example of how you should be able to implement the alphaNumeric rule using validation in CakePHP based on a simpliefied model called “User”:
class User extends AppModel

{
var $name = 'User';
var $helpers = array('Form');
var $validate = array(
'username' => array(
'loginRule-1' => array(
'rule' => 'alphaNumeric',
'last' => true,
'message' => 'Only letters and numbers allowed'
));
}

The rule in bold italics above is the one that doesn’t always work. However this can be easily rectified with a custom rule built on a regular expression seeking out valid alphanumeric strings.

To achieve this the alphaNumeric rule just needs to be replaced with this:

"rule" => array('custom', '/^[a-z0-9]*$/i'),

Problem solved.

  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • StumbleUpon
  • LinkedIn
  • Reddit
  • Netvibes
  • email

14
Oct 09

Keep linux scripts running after you have closed a remote shell.

I stumbled across this whilst importing 1.1TB of data from a server to Amazon S3 (more on that another day). What I wanted to achieve was to be able to ssh into my remote server, issue a command to push over 200,000 mp3′s up to Amazon and to be able to exit the shell and keep the process running.

The answer lies in a command line tool called screen.

Screen allows you to start a process on a virtual screen, then detach that screen and do something else (including log out). You can also reattach your screen after logging out and logging in again.

If you dont have the screen command on your remote linux box, first install it either from source or using your favourite package manager. Then login into your remote box and run your desired command prefixed with “screen”. For example:

screen top

Now to detach the screen use CTRL+a followed by d. This will detach your screen and you can go about any other business, including quitting your remote session.

Reattaching you screen at any time is as simple as running the command:

screen -r

You can detach and reatach your screen as much as you want until your running process is finished or you kill it, at which point your virtual screen is killed too.

  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • StumbleUpon
  • LinkedIn
  • Reddit
  • Netvibes
  • email

22
Sep 09

British Sign Language Support – New Zumo Internet Launch

Over at my Web Development Agency in Spain we’ve been busy again and we are pretty chuffed with the results. Once again working with TMax Media we have built and just launched BSL Homework Support a website that offers resources, and assessments for anyone interested in learning sign language.

We cut the XHTML, wrote the CSS and used PHP and MySQL to power the online purchasing and content retrieval system. The site features thousands of video clips that we deliver using jQuery and some elegant third party applications such as Shadowbox and JWPlayer.

If you are looking for something special for your next web project, or you’re a media agency looking for a reliable and talented web development service, please email info@zumointernet.com and we’ll let you know what we can do to you.

  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • StumbleUpon
  • LinkedIn
  • Reddit
  • Netvibes
  • email

10
Sep 09

CEIP Mariana Pineda, Benalmadena, Arroyo de La Miel

Hopefully this may help someone else find the contact number for this school which is not correctly listed on either the Yellow Pages in Spain or the Junta de Andalucia’s website.

The telephone number is 951 293 997

In case you are wondering why it is so hard to find: the school is fairly new and is listed as a plot of land still on the Junta’s site. I’m guessing the amount of paper work needed to get a website change actioned is far greater than the parent’s need to contact a school.

The official listing is here.

  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • StumbleUpon
  • LinkedIn
  • Reddit
  • Netvibes
  • email

03
Sep 09

Summer Fields School – New Zumo Internet Launch

Whoops we did it again. Another Zumo programmed site has left the building, this time in the shiny coat of Summer Fields Prepartory School.

TMax Media designed the site and Zumo Internet cut the code and programmed the CMS and front end from start to finish with a smooth blend of XHTML, CSS, PHP, MySQL and jQuery. More reason to trust us with your web site development.

  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • StumbleUpon
  • LinkedIn
  • Reddit
  • Netvibes
  • email

21
Jul 09

Working with PHP’s simplexml and nodes with hyphens

Here’s a quick GOTCHA that may save at least one developer some time. Recently whilst working with some XML to import music into an mp3 download site I came across an issue accessing the values of specific nodes through the simplexml object that I created. The value always threw up zero.

The issue lies in node names containing hyphens, thus:

$object->album-title     returns     0

The answer is to wrap the object property (node name) containing the hyphen in curly braces.

$object->{‘album-title’}     returns     “London Calling”

Here’s hoping that helps someone.

  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • StumbleUpon
  • LinkedIn
  • Reddit
  • Netvibes
  • email

19
Jul 09

Thunderbird Software Update Failed. One or more files could not be updated

This is a software update loop that has been annoying me for a while now when Thunderbird tries to update itself on Windows. Well, before you go removing any files or removing Thunderbird and starting from scratch, try this somewhat abstract method. I’ll bet more times than not it works:

  1. Ctr+Alt+Delete and open your Process manager.
  2. End the process “Quickcam.exe”.
  3. Restart Thunderbird, install the update and sleep peacefully.
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • StumbleUpon
    • LinkedIn
    • Reddit
    • Netvibes
    • email

    11
    Jul 09

    Latest Zumo Internet Launch: Orange Business Survey Petition

    We’ve launched another client project over at Zumo Internet and this one is pretty exciting. We worked with 2 other media companies to provide a new survey application for the Orange UK’s business site.

    For our part we used jQuery, PHP and MySQL to write a custom built petition that triggers every nth visitor.

    It’s a tiny part of a huge site, but nevertheless we are pretty chuffed to have been involved.

    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • StumbleUpon
    • LinkedIn
    • Reddit
    • Netvibes
    • email

    08
    Apr 09

    New Launch Sports Recruitment International

    The latest project of my fledgling web design company in Spain, Zumo Internet has left the shelves. Sports Recruitment International is a re-tool of an already successful web site for a major recruiter of professionals in the sports and leisure industry.

    We built the site in co-operation with T-MAX media from Oxford. Our input was cutting the new designs into valid XHTML and CSS, building some custom jQuery functionality and programming new features into their content management system. The result is a high-impact site for a major corporate client – and all just as Zumo Internet turns 1.

    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • StumbleUpon
    • LinkedIn
    • Reddit
    • Netvibes
    • email