Add a new table using the install file
This is how you should add a new table for your module in the install file using the hook_update_N in Drupal 6
This is how you should add a new table for your module in the install file using the hook_update_N in Drupal 6
This is how you can install Drupal modules programmatically
<?php
function mymodule_install_features() {
$items = array();
drupal_install_modules(array( 'mymodule_cck', 'mymodule_views', 'mymodule_nodetypes'));
drupal_set_message("Installed features for Mymodule");
drupal_flush_all_caches();
return $items;
}
?>
And taxonomy
install_include(array('taxonomy'));
$props = array('module' => 'taxonomy', 'multiple' => 1);
install_taxonomy_add_vocabulary('Plants', array('article' => 'article'), $props);
$props = ar
/**
* Create simplenews node type.
*/
function _simplenews_install_nodetype() {
// Create a newsletter type.
This is how you add an Vocabulary in an install file or in a module.
/**
* Install
*
**/
...
$vocab_count = db_query("SELECT COUNT(vid) AS vid_count FROM {vocabulary}
WHERE name = '%s'", 'A name');
$vocab_count = db_fetch_object($vocab_count);
$vocab_count = $vocab_count->vid_count;
if ($vocab_count == 0){
$vocab = array();
$vocab['name'] = 'A name';
$vocab['description'] = 'A description';
$vocab['help'] = 'Some help';
$vocab['multiple'] = 0;
$vocab['required'] = 1;
$vocab['module'] = 'zimplicit';
$vocab['no
How to download and extract a drupal module on Linux
wget http://ftp.drupal.org/files/projects/phpmailer-6.x-2.1.tar.gz
gunzip phpmailer-6.x-2.1.tar.gz
tar -xvf phpmailer-6.x-2.1.tar
rm phpmailer-6.x-2.1.tar
Here is the code that makes your module able to override other modules. Drupal uses a modules weight, stored in systems table when loading modules. The higher weight the later your module is loaded. You can use this if form_alter on an other modules form doesn't work and things like that.