From MSAccess to Localexchange

The marathon run for importing Norwich LETS's msaccess-based database to LocalExchange's MySQL-based database has ended a while ago. It took almost 7-8 hours and pushed my SQL knowledge to its limits. Here's how I did it.

0. Open database in MSAccess and export all tables as CSV file.

1. Make a list of columns in each table and create identical tables in MySQL.

2. Import the tables from the CSV files into MySQL:
$ mysqlimport -u dbusername -p --local --fields-terminated-by=, --fields-enclosed-by='"' --lines-terminated-by='\r\n' norlets tablename.txt

Drupal, form, #pre_render

If you are getting the following error message after adding a new element in any of your pre_render functions, then you haven't created all the necessary properties for that element:


warning: implode() [function.implode]: Bad arguments. in /home/ju/public_html/drupal-5.1/includes/form.inc on line 618.

When adding elements in a pre_render function, these properties must be manually added:

  • #description
  • #required
  • #tree
  • #post
  • #parents
  • #attributes

    Setting up phpBB3

    Here's what I did to install and get a phpBB3 (RC4) site up and running:

    0. Installed it just like another LAMP application.

    1. Copied /styles/subsilver2 to /styles/bxl. So bxl is now a new theme. I selected it as the default theme for the site by clicking "install" against "bxl" from "Styles [tab] > styles" and then selecting it as the default theme.

    2. Edited all *.cfg files (4 in total) under /styles/bxl/

    3. Make necessary changes to /styles/bxl/theme/style.css.

    4. Uploaded mylogo.jpg to /styles/bxl/imagesets/

    Installing and customizing Zen Cart.

    Unlike Drupal I haven't yet managed to figure out how to put Zen cart in a separate directory under a website's webroot and still hide the directory name.

    Zen cart takes a lot more time then Drupal to customize. I'll now describe the process of slightly modifying a default install of Zen cart so that it looks quite our own. So here goes the steps -

    0. Download, uncompress and upload Zen cart in a directory under your webroot.

    Keeping Drupal in a subdirectory under website root.

    I don't like the idea of flooding your site root with all files found in Drupal's top level directory. If your site root is located at /usr/local/www/data/, then I'll place Drupal at /usr/local/www/data/cms or somewhere else in your filesystem. But I don't like the idea of accessing your site as www.example.com/cms either. mod_write solves all of these. So I place/add the following in the .htaccess file of a website's top level directory -

    RewriteEngine On
    RewriteRule ^(.*)$ cms/$1 [L]

    Drupal module writing

    There are several types of Drupal module - node, block, filter, etc. Each module needs at least 2 files. The first one is module_name.info and the other is module_name.module. The info file contains information about the module and the module file is the actual source file. If the module needs any action during installation, then required code goes into the module_name.install file.