Drupal multisite with shared tables

Drupal allows you to create multiple sites sharing some or all of the same code and optionally sharing some database tables.

The documentation for the Drupal settings file
http://api.drupal.org/api/file/sites/default/settings.php/5/source

includes the following

<?php
/*
* To have all database names prefixed, set $db_prefix as a string:
*
* $db_prefix = 'main_';
*
* To provide prefixes for specific tables, set $db_prefix as an array.
* The array's keys are the table names and the values are the prefixes.

Read more

Don't make me think!

cover of Don't make me think! Don't Make Me Think!: A Common Sense Approach to Web Usability
Steve Krug
* * * *
£19.51

buy from amazon

 

This book is well written, short, and clear.

It has reassured me about much of what I do - and given me some pointers for areas I can improve on.

One of the great things about this book is the way it addresses the combination of technical and political issues that web projects can get bogged down in - it has a nice section called "Help my boss wants me to ___" with some good sample letters to the boss.

It really brings home that conventions are useful - and you need to test the site on users - little and often.

Read more

What is a Drupal node?

One of the things that is confusing about Drupal is the use of the word node.

Going to the dictionary doesn't help much:
http://dictionary.reference.com/browse/node
http://www.answers.com/topic/node

In my opinion "node" is just the wrong word.

When you read node think content.

Content (in the context of a website) means something that is displayed to users.

Content can be text, images, video, even flash games.

So when you create a node in Drupal you are creating content.

Read more

MySQL restore is very slow

It seems there is a bug in MySQL which is causing restores to run very slowly (hours instead of minutes)

http://bugs.mysql.com/bug.php?id=33057

The bug is fixed in release 5.0.67

But Ubuntu hasn't updated yet....

Fortunately this bug is specific to the command line client. 

Workaround: use the MySQL Administrator GUI instead.

Read more

SQL for Smarties

cover of SQL for Smarties Joe Celko's SQL for Smarties: Advanced SQL Programming (The Morgan Kaufmann Series in Data Management Systems)
Joe Celko
* *
£30.39

buy from amazon

 

I was really looking forward to reading this book, it had been on my wish list for years....

But it's hard to know how to tackle it.

This is a heavyweight book and it's mostly organised by SQL keyword with some chapters on subjects like temporal queries and statistics.

It seems to me that the best way to read this book is cover to cover - but for me it's just to big to do that.

The book also suffers from being too oriented towards 'pure' SQL, spending pages on features that aren't yet available.

Read more

Adding comments to the database

Comments in code are widely used and generally (but not universally) accepted as a good thing.

Databases can also accommodate comments - but these seem to be very rarely used.

I'm of the opinion that database comments are very useful.

It's often hard to determine the exact meaning of a column - maybe it would be ideal to rename the column but you don't want to risk breaking code.

Read more

PracticalWeb Joins Drupal Association

PracticalWeb Ltd today joined the Drupal Association

Drupal Association Membership Badge

The membership fee helps support the drupal.org infrastructure and marketing costs.

It's  also a small thank you for all the terrific work built up by the whole Drupal community.

 

Read more

Install runkit for unit testing

Unit testing Drupal can be pretty challenging as it's hard to isolate parts of the code.

It seems :

Read more

Drupal Object Orientation

One of the surprising things about Drupal is that it doesn't use object oriented coding.

There's a good page in the Drupal documentation about this

http://api.drupal.org/api/file/developer/topics/oop.html

It makes a good case for the design of Drupal, and goes a long way to explain why Drupal feels more OO than the code looks at first glance.

There has been discussion on the mailing list

Read more

Time to upgrade to Drupal 6?

Drupal 6 has been out for a while now, Drupal 7 is in the works, and yet most sites still seem to be using Drupal 5. Is it time to upgrade yet?

If it was just the core features the answer would be simple, Drupal 6 is better and is fully stable.

The problem is that many (maybe most) of the features of a Drupal website are powered by contributed modules, and modules written for Drupal 5 don't work with Drupal 6.

Read more