Oliver Davies

Freelance Drupal Developer

Drupal

Optimise your Drupal Theme for an iPhone or iPod

30/11/2010 -- Oliver Davies

To begin with, enter the following code at the top of your page.tpl.php file:

 

{syntaxhighlighter brush: php;fontsize: 100; first-line: 1; }<?php
if (ereg('iPhone',$_SERVER['HTTP_USER_AGENT'])) {
$iphone = 1;
} elseif (ereg('iPod',$_SERVER['HTTP_USER_AGENT'])) {
$iphone = 1;
} else {
$iphone = 0;
}
?>{/syntaxhighlighter}

This creates an 'iPhone' variable, and sets its value to 1 if the an iPhone is being used. The value of the variable can then be used in an 'if' statement to create content that's only shown if an iPhone is being used.

The Inaugural Meetup for the South Wales Drupal User Group

27/09/2010 -- Oliver Davies

If you do Drupal, and you're in the area, come and join us for the first South Wales Drupal User Group Meetup!

We'll be meeting in the communal area just outside of the SubHub HQ, at:

4, The Studios

3 Burt Street
Cardiff

CF10 5FZ

For more information and to signup, visit http://groups.drupal.org/node/95104.

How to Create and Apply Patches

10/09/2010 -- Oliver Davies

Earlier this year, I posted a solution to an issue on the Drupal.org issue queue. Originally, I just posted the code back onto the issue, but have now created a patch that can easily be applied to any Drupal 6 installation. Here is a run-through of the process of creating and applying a patch. In this case, I made changes to the user_pass_validate function that's found within /modules/user/user.pages.inc.

Create a Better Photo Gallery in Drupal - Part 2

17/08/2010 -- Oliver Davies

At the end of my last post, I'd finished creating the first part of the new photo gallery, but I wanted to change the dates of the published photos to reflect the ones on the client's original website.  

Firstly, I'll refer to the previous list of published galleries that I created before, and create something different that also displays the created and modified dates. Picking the node ID of the required gallery, I used the following SQL query to display a list of photos.

 

Create a Better Photo Gallery in Drupal - Part 1

12/08/2010 -- Oliver Davies

Recently, I converted a client's static HTML website, along with their Coppermine Photo Gallery, into a Drupal-powered website.

Over the next few posts, I'll be replicating the process that I used during the conversion, and how I added some additional features to my Drupal gallery.

Pages

Subscribe to RSS - Drupal