2009-11-28

DrupalORM: As a programmatic ORM interface to nodes and their CCK fields

I have recently put up an initial development version of DrupalORM. This provides a nice OOP-like ORM interface to Drupal nodes. It can handle basic CRUD operations as well as handling recursive nodereference nodes. The project is located at http://drupal.org/project/orm/.

2009-11-26

Fixing Weak Wireless on Asus EEE PC With Ubuntu 9.10

As a quick google search will show, the wireless signal on the Asus EEE PC for Ubuntu 9.10 is pretty terrible. I found this little trick to work quite well. (Perform at your own risk)
$ sudo apt-get install linux-backports-modules-wireless-karmic-generic

2009-08-17

Write to HFSPlus Formatted iPod From Linux (Ubuntu)

If you have an ipod which was formatted in iTunes for OSX, it will most likely be formatted with the HFSPlus filesystem with journalling enabled. Ubuntu, by default can write to HFSPlus, but only if journalling is disabled. To write to your iPod, you will need to issue the following command from within the terminal in OSX...
diskutil disableJournal /Volumes/NAME-OF-IPOD

2009-08-03

Enabling Memory Profiling for xDebug 2

XDebug has not had memory profiling for the last couple of years. I am not sure why it was taken out, but it was. The APD memory profiling seems for the last year or so to be completely broken, so that is no good as well. There is a patch over at http://xdebug.org/archives/xdebug-general/1228.html which will allow for memory profiling in xdebug.

2009-07-31

Using GnuCash With Bank of the West

This is not a tutorial for how to setup GnuCash. There is plenty of documentation out there for that. This, however will give you the settings you need to integrate GnuCash with Bankofthewest etimebanker service. This assumes you live in the USA. Have fun.
* AqBanking Wizard

  * Users > General...

    * User Name: (your name)

    * User ID: (your etimebanker id)

    * Customer ID: (your etimebanker id)

    * Country: United States of America

    * Bank ID: (your bank routing code, found at bottom of your check)

  * Users > OFX...

    * FID: "5809"

    * ORG: "BancWest Corp"

    * Server URL: "https://olbp.bankofthewest.com/ofx0002/ofx_isapi.dll"

    * Server Options

      * Supports account list download

      * Supoorts statement download

      * Force SSLv3

    * Expert Settings...

      * APPID: "QWIN"

      * APPVER: "1800"

    * Header Version: "102"

  * Accounts > General...

    * Account Settings

      * Name: "DIRECT CHOICE CHECKING" or "SAVINGS INTEGRATED - PERSONAL"

      * Number: (your account number)

      * IBAN: (blank)

      * Owner Name: (your name)

      * Type: "CHECKING" or "SAVINGS"

    * Available Users...

      * All users of this backend

      * Add user

    * Bank Settings

      * Code: (bank routing code)
   
      * BIC: (blank)

      * Name: "Bank of the West"

2009-04-16

Theming the Drupal 6 User Login Form

There are a great deal of articles out there on theming the Drupal User Login Form, but most don't give you granular control over each individual form element. Rather, you are restricted to mainly editing the css. Here is a way to have complete granular control over each element within the user login form... 1. Place this function either in a module or in your template.php:
function get_user_login_form() {
  $form_id = 'user_login';
  $form = array();
  $form['name'] = array(
    '#type' => 'textfield',
    '#maxlength' => USERNAME_MAX_LENGTH,
    '#required' => TRUE,
    '#attributes' => array('tabindex' => '1'),
  );
  $form['pass'] = array(
    '#type' => 'password',
    '#required' => TRUE,
    '#attributes' => array('tabindex' => '2'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Log in'),
    '#weight' => 2,
    '#attributes' => array('tabindex' => '3')
  );
  $form['#validate'] = user_login_default_validators();
  $form['#build_id'] = sprintf('form-%s', md5(uniqid(mt_rand(), TRUE)));
  $form_state = array();
  drupal_prepare_form($form_id, $form, $form_state);
  drupal_process_form($form_id, $form, $form_state);
  $out = new stdClass;
  $out->form_start =
    sprintf("<form method='post' accept-charset='UTF-8' action='%s'>",
    url('user/login'));
  $out->form_end = "</form>";
  $out->name = drupal_render($form['name']);
  $out->pass = drupal_render($form['pass']);
  $out->submit =
    drupal_render($form['form_id']) .
    drupal_render($form['form_build_id']) .
    drupal_render($form['submit']);
  return $out;
}
2. In your .tpl.php file, output the fields
<?php
  $login_form = get_user_login_form(); 
?>
<?php print $login_form->form_start; ?>
  Username: <?php print $login_form->name; ?><br />
  Password: <?php print $login_form->pass; ?><br />
  <?php print $login_form->submit; ?>
<?php print $login_form->form_end; ?>