What's been on my mind

Funny, strange, weird borders in drupal template (in firefox and not ie)?

Submitted by charles on Tue, 06/12/2007 - 13:06
Took me forever to figure out that this was due to a tbody style in system.css. This border only showed up in firefox and not in internet explorer. The system style is: tbody { border-top: 1px solid #ccc;} I added this to my theme stylesheet: tbody { border: none;} Not sure if I'm missing something here, but this worked for me.

How to get the path to your theme in your drupal template

Submitted by charles on Tue, 06/12/2007 - 12:52
Instead of hard coding your theme path into your drupal theme templates, it's better to use some built in drupal functions or template variables:
  • Use the $directory variable which will be available in your .tpl.php files
  • Use the path_to_theme() function - this provides the same output as the $directory variable
  • Use the base_path() function which will give you the url to the root of your site.
I always use absolute references, for example:

Podcast on virtualisation

Submitted by charles on Sun, 05/13/2007 - 09:53
Virtualisation is going to be big! Apart from the benefits for businesses in server consolidation, virtualisation also is promising for software developers in utilising virtual appliances: "preconfigured, pre-installed virtual machine that includes the operating system and the application, all encapsulated in a virtual machine so that people can take a virtual appliance and install it", with out installing the operating system, configuring the operating system and the application". Check out the podcast on IT Conversations.

Adobe Kuler for colour ideas and cool colour functions in Adobe Illustrator CS3

Submitted by charles on Sun, 05/13/2007 - 09:36
If you are looking for design ideas for colour schemes, check out Kuler (http://kuler.adobe.com). This is a site set up by Adobe which allows users to post colour schemes, and there's some great stuff there. Also, if you're an Adobe Illustrator user, check out this video on illustrator cs3 - there's some pretty amazing stuff you can do with colours...

Open docx and xlsx files in older versions of word and excel

Submitted by charles on Mon, 03/05/2007 - 11:47
I've received a couple of files in the new microsoft office 2007 file formats, and as I have as yet not upgraded, was not able to open them. There is now a compatability pack that's been released that will allow you to open new files in older versions of office: download it here. Read the overview and system requirements first!

Drupal node insert error related to the sequences table

Submitted by charles on Fri, 02/09/2007 - 12:53

I recently added a lot of data to a drupal site by running some scripts that I'd created in php. This was to save me the time of manually capturing the content. After successfully adding the content, when I tried to add a new content item, I got the following error: Warning: Duplicate entry '503-503' for key 1 query: INSERT INTO node (nid, vid, title, type, uid, status, created, changed, comment, promote, moderate, sticky) VALUES (503, 503, 'World Bank ', 'content_organisation', 1, 1, 1171017191, 1171017191, 2, 1, 0, 0) in It turns out that Drupal uses the sequences table to keep track of what the highest id in certain tables is. I had forgotten to update this table with the id of the most recent node that I'd added.

MySQL case sensitivity of table names between windows and linux systems

Submitted by charles on Wed, 02/07/2007 - 14:53
While I normally stick to all lowercase table names for my MySQL database tables, I often have to come in on a project where the database has already been set up using a mixture of lower and uppercase table names. Because windows is case-insensitive, when you create a MySQL table or export tables for use on a linux system, all table names will be lowercase by default. This will cause problems when the dump imported into MySQL on linux, as any calls to the original mixed case tables will result in errors, as these tables don't actually exist.

Checking for PHP module dependencies

Submitted by charles on Fri, 09/08/2006 - 19:19
I'm putting together an OpenLDAP authorisation system for a client's business web application, and wanted to test things out on my local windows machine. Well, I managed to get OpenLDAP working fine, but the authorisation using Apache has not been easy (in fact I'm still struggling with it ...). In the process, I've uninstalled and reinstalled php and apache a number of times to try and see where the problem is. This has in itself caused it's own issues, one of which was a php module not being loaded by apache.