/[drupal]/contributions/modules/technorati/technorati.install
ViewVC logotype

Diff of /contributions/modules/technorati/technorati.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Sat Oct 28 02:17:35 2006 UTC revision 1.2, Sun Jul 27 16:28:34 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: technorati.install,v 1.1 2006/10/28 02:17:35 kbahey Exp $
3    
4  // Copyright 2006 http://2bits.com  /**
5     * @file
6     * Installation and uninstallation code for the technorati module.
7     *
8     * Copyright (c) 2006 http://2bits.com
9     * Copyright (c) 2008 Jan Dittberner <jan@dittberner.info>
10     */
11    
12    /**
13     * Implementation of hook_install().
14     */
15  function technorati_install() {  function technorati_install() {
16    switch ($GLOBALS['db_type']) {    $result = drupal_install_schema('technorati');
17      case 'mysqli':  
18      case 'mysql':    if (count($result) > 0) {
19        $result = db_query("      drupal_set_message(t('technorati module installed.'));
20          CREATE TABLE {technorati} (    }
21            nid INT  NOT NULL default '0',    else {
22            tags TEXT NOT NULL default '',      drupal_set_message(t('technorati table creation failed. Please "uninstall" the module and retry.'));
23            PRIMARY KEY nid (nid)    }
24          ) /*!40100 DEFAULT CHARACTER SET utf8 */;");  }
25        break;  
26    /**
27     * Implementation of hook_uninstall().
28     */
29    function technorati_uninstall() {
30      drupal_uninstall_schema('technorati');
31    
32      // delete variables
33      variable_del('technorati_display_type');
34      foreach (node_get_types() as $node_type => $node_name) {
35        variable_del('technorati_node_type_'. $node_type);
36    }    }
37    
38      drupal_set_message(t('technorati module uninstalled.'));
39    }
40    
41    /**
42     * Implementation of hook_schema().
43     */
44    function technorati_schema() {
45      $schema['technorati'] = array(
46        'fields' => array(
47          'nid'  => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE,
48                          'default' => 0),
49          'tags' => array('type' => 'text', 'size' => 'normal',
50                          'not null' => TRUE, 'default' => '')
51        ),
52        'indexes' => array(
53          'nid' => array('nid')
54        ),
55        'primary key' => array('nid'),
56      );
57    
58      return $schema;
59  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2