Our Blog: The Archive

Aug3rd

Comments Off

New Apple Mac User Tip – Backup CD’s the way you need to

Tags for post entry: New Apple Mac User Tip – Backup CD’s the way you need toWritten by Jon Webb on November 3rd, 2009, Posted in Press Releases |

Tags for post entry: New Apple Mac User Tip – Backup CD’s the way you need to

As a new user to the Mac I find it irritating not being able to make a 1:1 copy of a legitimately purchased audio cd without having to pay for a bit of software to do it for me.

Thankfully I came across this little gem which allows you to copy cd’s / dvd’s the way you want to, for free – http://simplyburns.berlios.de/

Aug25th

Comments Off

Greenwich Action for Voluntary Service Website Launch

Tags for post entry: Greenwich Action for Voluntary Service Website LaunchWritten by Jon Webb on September 25th, 2009, Posted in New Projects, News |

Tags for post entry: Greenwich Action for Voluntary Service Website Launch, , ,

We’re pleased to announce the launch of a new website for the Greenwich Action For Voluntary Service (GAVS), in association with Firefly Creative.

Our Role

greenwich-action-for-voluntary-service-home-page

Firefly approached us to provide the technical consultancy and build of the GAVS website, and when we saw the initial designs we knew that Firefly certainly pushed the design boundaries with an attractive translucent feel to the website. From design to complete content managed solution – we delivered a solution which allows GAVS to: update almost all content on the website; create new sections, and; optimise their website for search engines.

On-top of all this we also:

  1. Integrated Yahoo’s Upcoming Events service. This service drives their events management section, and allows GAVS to broadcast their events and training seminars to a wider, world-wide audience.
  2. Provided a custom, secure membership section which gives members of GAVS the ability to subscribe and download essential content. We gave the GAVS Editorial team the power to approve, suspend, delete and generally manage all their subscriptions.
  3. Provided key editorial control over various accessibility features, such as the “accesskey”, Allowing GAVS to meet their minimum requirements for accessibilty.

The site was delivered on time, and above spec.

About GAVS

GAVS exists to provide a strategic leadership role to support the development of voluntary, community and faith organisations, within the borough of Greenwich, London.

Visit the new website: Greenwich Action for Voluntary Service

Aug10th

Comments Off

Wordpress Tip – Turn off Allow Pings and Comments by Default

Tags for post entry: Wordpress Tip – Turn off Allow Pings and Comments by DefaultWritten by Jon Webb on September 10th, 2009, Posted in Wordpress |

Tags for post entry: Wordpress Tip – Turn off Allow Pings and Comments by Default

As part of my week long campaign to divulge some useful information about customising Wordpress into a decent Content Management Solution for small businesses I’ve got another top tip – however this is a developer related top tip and involved rummaging around in the database.

The tip

Today’s tip is about how you can turn off the “Allow comments on this post”, and “Allow trackbacks and pingbacks on this post” options by default on your Wordpress site.

Wordpress Discussion Defaults Tick Boxes

Wordpress Discussion Defaults Tick Boxes

The Solution

In the wordpress database, specifically the wp_options table, there are two options under the option_name column called:

  • default_comment_status
  • default_ping_status

If you run the following SQL query against your Wordpress database’ wp_options table:

select option_name, option_value from wp_options where option_name in('default_ping_status', 'default_comment_status');

It yields the following results:

+------------------------+--------------+
| option_name            | option_value |
+------------------------+--------------+
| default_comment_status | open         |
| default_ping_status    | open         |
+------------------------+--------------+

As you can see – the default is always set to allow comments and pings on all new pages and posts. Now, update the option_value column relating to the default_comment_status and the default_ping_status with the value closed. Now Wordpress will no longer allow new pages/blog posts to be saved with these options open to the world. See the following SQL command on how to achieve this.

Note: it’s always wise to backup before making this sort of update, and on a Wordpress MU installation you will want to add a WHERE clause so that you only target the wordpress site you intend to change these options for.

update wp_options set option_value='closed' where option_name in('default_ping_status', 'default_comment_status');

Tada!

Discussion Meta Box with Defaults set to off

Discussion Meta Box with Defaults set to off

See the Wordpress Options Reference documentation for further information.

Aug8th

Comments Off

Customising cforms2 – A wordpress plugin

Tags for post entry: Customising cforms2 – A wordpress pluginWritten by Jon Webb on September 8th, 2009, Posted in Wordpress |

Tags for post entry: Customising cforms2 – A wordpress plugin

As you may be aware I’m a firm supporter of using Wordpress on small websites as it gives web developers a quick and easy path to giving small businesses a cost effective web presence. But what happens when a Wordpress plugin only gets you 80% of the way there?

So today this blog post is about customising the excellent cformsII wordpress plugin which allows developers and end users alike to create fully featured contact and data capture forms within a Wordpress based website.

I’ve got a requirement where I use the cformsII plugin to create a membership registration form. The extra requirements for this registration form are that alongside the normal input checking for the form – I also need to check that an email address has not already been used within the Wordpress database for a user.

Unfortunately, cforms2 does not natively support this so I need to customise the plugin. To keep this customisation to a minimum I’m going to change the least amount of the cforms core to acheive the ability to validate this email address against the database.

Here goes, code examples follow along with some caveats:

  1. These code examples need basic understanding of PHP as to how and why things are done.
  2. Your cforms form must not be AJAX enabled – otherwise the validation routines do not work.
  3. You should always make a backup of your plugins directory before modifying any plugins

To start off with we need to change the cforms lib_validate.php which can be located in your ./wp-content/plugins/cforms/ directory of your wordpress installation. You need to go to approximately line 203 of this file, you’ll see following line of code around line 203:

$all_valid = $all_valid && $validations[$i+$off];

Directly above this line you’ll need to cut and paste the following code. This code instructs cforms to pass the form field data to your custom validation function. It also passes the results of the validations cforms has already performed on the field so that you can selectively choose to process the field again.

if(function_exists('cforms_custom_validation'))
{
    $result = cforms_custom_validation($input_name[1], $current_field, $field_type, $validations[$i+$off], $c_err[1]);
    $validations[$i+$off] = $result[0];
    if($result[0] == false)
    {
        $c_err[1] = $result[1];
        $err = 1;
    }
}

Next we need to make use of the code we’ve just inserted into the core of cforms2. To do this we need to create the following directory & file, or edit the file:

(wordpress installation root)/wp-content/plugins/cforms-custom/my-functions.php

and insert the following code:

function cforms_custom_validation($fieldId, $fieldValue, $fieldType, $existingResult, $existingError)
{
    // Create an array $returnValue which contains a default return value, this array is comprised
    // of the first element being the existing validation result so you can check if cforms has
    // already validated it as bad. The second element of the array is incase cforms has given
    // any custom error message which you may need to re-use.
    $returnValue = array($existingResult, $existingError);
    // Check two things before running the custom validation:
    // 1.) That cforms hasn't already marked this field as invalid, and;
    // 2.) Check the $fieldId passed is the one I want - this should be more robust, but suits my needs
    if($existingResult == true && $fieldId == 'Email address[id:user-email]')
    {
        //do custom validation
        $result = TonicUser::Exists($fieldValue);
        if($result->status == true)
        {
            //set the return value: the first element being false, as the validation failed. The second being 'Oops' which is your failure message.
            $returnValue = array(false, 'Your email address has already been used to register an organisation');
        }
    }
    return $returnValue;
}

You’ll see a comparison being made: $fieldId == ‘Email address[id:user-email]‘ . The ‘Email address[id:user-email]‘ part is directly related to the following screenshot. I hope the comments against the rest of the code are relatively self explanatory.

Screenshot showing the field id used in the code comparison

Screenshot showing the field id used in the code comparison

Hope that helps WP users.

Aug4th

Comments Off

Mac Usability

Tags for post entry: Mac UsabilityWritten by Jon Webb on September 4th, 2009, Posted in Random |

Tags for post entry: Mac Usability

Seriously! If the mac’s are supposedly better engineered than the rest of the competition – why do they put the close application (cmd + tab) keyboard shortcuts right next to switch window (cmd + tab) short cuts? As a heavy keyboard user, and one who is new to an Apple Mac and continues close his applications instead of switching windows it is highly irritating.

Answers on a postcard.