Adding the new google plus one (+1) button to your Drupal site

2nd Jun 2011

I am sure someone will roll a module very soon, but in the meantime I thought I would blog about our first experiences in adding the plus one button ...

There is plenty of background on the google plusone button already -

It sounds very simple, and indeed it is - with only one small gotcha that we couldn't find any documentation for. We basically followed the steps outlined here : which is simply :

  1. Include the google plusone javascript file somewhere on your page - recommended in the footer.

  1. Work out the layout of your plusone button,...

Read more

ComputerMinds become Silver sponsors of DrupalCon London

2nd Jun 2011

We are all very excited about DrupalCon coming to London (well London-ish - ) - and now that we are Silver sponsors we are literally jumping for joy ... now we just need to think of something to put on our very own exhibitor table ...

Read more

Drupal database prepared statements

25th May 2011

Drupal 7's database layer is awesome, it is built upon PDO and one of the great things about PDO is named placeholders, they allow you to build queries like:

$unsafestring = "this string can contain quotes: ' or other things";
$query = db_select('table')
           ->condition('field', $unsafestring);

The SQL that is sent to the database is:

SELECT table.* FROM table WHERE (field = :db_condition_placeholder_0)

This is sent along with the contents of $unsafestring to replace the :db_condition_placeholder_0 token. Note that this isn't some lame string replacement, but an actual argument for the SQL statement.

This has some interesting implications for converting...

Read more

Facebook share links - controlling the data sent

22nd Apr 2011

Not strictly a Drupal post this, but something that I was playing with yesterday that I was really struggling to find any documentation on. We wanted a simple "share" on facebook link, we didn't want to go through the process of creating an app and using the opengraph API - instead we just want to use the simple sharer.php script but have a bit of control over what is being shared.

The basic approach is you are providing a link to which is the basic share page (typically this is shown in a popup).

By adding querystring params we...

Read more