Drupal 6.x

How to send argument to drupal_get_form()

This is how you send arguments to your own form when using drupal_get_form() in Drupal 6.x. This function has no required argument, but receives $form_state as first argument. Declare a first argument for $form_state and then your arguments, as many as you need.


<?php
function my_module_begin_form($form_state, $my_arg = array(), $another = "") {
...
}

...

$out = drupal_get_form('my_module_begin_form', $my_arg, $another);
?>

Set page template file to use based on content type

If you want to change page.tpl.php to a different one based on the content type you can add a condition in preprocess_page function in your themes template.php file.
Probably you have a phptemplate_preprocess_page() or a [your_theme]_preprocess_page().

<?php
function phptemplate_preprocess_page(&$variables) {

  if (
$variables['node'] && arg(2) != 'edit') {
    
$variables['template_files'][] = 'page-'. $variables['node']->type;
  }
 
}
?>

Then make a copy of page.tpl.php and rename the copy to page-[your-content-type].tpl.php, and make the changes you want.

Settings in Drupal at One.com

One.com is really cheap and it's pretty easy to set up a Drupal site. Some disadvantages are that it is only one database, and that max_execution_time is set quite low (30sec) so that admin/build/modules do not have time to finish, for example if you have admin_menu module and some other more demanding modules installed. Furthermore, the memory_limit is set to 24MB which can be too low if you have demanding modules.

$db_url = 'mysql://domain_xx:password@localhost/domain_xx';
$db_prefix = '';

Pages