Richard Parnaby-King

Web Developer – PHP, Zend Framework and Actionscript 3

Gravity Forms – Moving the validation errors message ABOVE the pagination controls

Posted on | June 15, 2018 | No Comments

Wow, there’s a title!

Gravity Forms is a WordPress plugin that allows the user to create and manage a collection of forms to be published on posts and pages. An example of this is a simple Contact Us form. One of the features of Gravity Forms is the ability to paginate the form. That’s right! If you have 50 form elements, instead of having them all on one page, you can break them up to five pages of 10 form fields a page.

Another feature is the built-in validation! Gravity Forms will validate user data against the form element types to ensure that the data you end up with is the data you want. Any failed validation messages will be collated and displayed between the pagination and form! Fantastic!

Unless the design is for the pagination to be down the left sidebar. At which point the validation message sits above the form, but next to the top of the pagination. This triggers my personal OCD – the validation messages should be shown above the whole caboodle!

Read more

Add products to category quickly!

Posted on | June 4, 2016 | No Comments

Code When dealing with Magento, the common knowledge to bulk update products is to pull in a collection and, in a loop, load the product, change the attribute and save.

A client is syncing their product database from their system to Magento, but their system only allows a product to be in one category. I was asked to run a cron script nightly to check for an attribute on the product and place those products into an additional category.

Knowing how slow save() is, I started to dig around and come up with the below code.

Benchmarking this code against the regular way of doing it, I saw the times drop from about an hour and a half for 1,200 products to five seconds!
Read more

Reviews Stars

Posted on | March 11, 2015 | No Comments

css-code When viewing a product we all like to see what other people have said about it, so our first stop is to look at the overall customer rating for this product. This is usually in the form of empty/full/partially filled stars out of five.

Review Example

This blog post will teach you how to create a stars-rating using very little HTML and CSS.

Read more

Google Minify and Far Future Expires Header

Posted on | November 3, 2014 | No Comments

MinifyGoogle takes into account page load time into its ranking algorithm. As such, web developers the world over are trying to squeeze as much functionality into as few bytes as possible. This is where Minifiers come into the picture – they automatically remove all un-needed bytes from javascript and css files before sending them to the user. Less bytes means less load time. This is all well and good, but a new issue crops up when using Google Minify – the Expires header is not a Far Future Header. This blog post explores what a far future expires header is, and how to configure Google Minify to fix the issue.
Read more

Get all emails from Gmail with a specific label, using Google App Scripts

Posted on | May 15, 2014 | 1 Comment


Something I use at work is a task-tracking website. At the basic level, you give the task a short title, a long description, one or more flags, and estimate how long it will take to complete. A cool feature of this website is that they offer an api for registered users.

The boss wants any IT support issues to be logged into this task-tracking website so that any of the support team can see what has or has not been started and fix the issue.

All issues for IT support are being sent to a single mailing list on Gmail. This, I thought, is a perfect opportunity to play with Google Apps Scripts.

In this blog post I am going to show how to get your recent emails from Gmail, and POST to an API depending on the email’s label.

Read more

Providing user feedback on background operations

Posted on | September 4, 2013 | No Comments

On any website that does any form of background operation that prevents the user from progressing immediately (for example an ajax operation that updates search filters based on the currently selected option) then the user needs to be informed.
Read more

Some jQuery Optimisations

Posted on | May 31, 2013 | 2 Comments

Sometimes you may think you are doing a nice simple effect in jQuery. In reality, you are making hundreds of unnecessary DOM calls and updates every second. And you wonder why the effect is taking so long to run.

This post hopes to teach you how to optimise your code to run that little bit quicker.
Read more

Magento XML Setting Parameter Values

Posted on | May 28, 2013 | No Comments

xmlAh the strength and failings of Magento. Of all its features, the ability to control nearly all of the layout from a single local.xml file is my favourite. One of the main features of this approach is that you can call functions (called actions) to add, remove or override values for the block you are working on. But what is the correct way to specify the value?
Read more

Notepad++ VS Sublime 2

Posted on | May 13, 2013 | 12 Comments


Where I work nearly every other developer is using Sublime 2, whereas I am working on Notepad++. Having seen the features and the way the other developers have set up their Sublime 2 environments, I have fought against the peer-pressure as I believe that Notepad++ is the same as (if not better than) Sublime 2 as both use plugins to do pretty much the same thing.

Here is your chance to change that. This poll will be ran for a few weeks, then I will go with the winning option.

Read more

Zend Framework Routing Solutions

Posted on | April 18, 2013 | 6 Comments

Routing is the action of taking the requested url and pointing the application to the correct module, controller, and action so that the request can be correctly processed. There are a number of ways to implement this using the Zend Framework, the most common of which is to create a routing object in the application bootstrap file. An alternative, which this blog post explores, is to store all possible urls in your database, with the corresponding default route stored alongside it.

Read more

keep looking »

    Having fifteen years of programming experience in PHP, Zend Framework and ActionScript3, I have a very strong working knowledge of object orientated programming.

    I am a PC Gamer! Playing FPS, RTS, RPG and the occasional MMO since 1996 I have a huge number of a variety of fast-paced games.

  • Recent Posts

  • Categories