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

Contents of /contributions/modules/technorati/technorati.install

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


Revision 1.2 - (show annotations) (download) (as text)
Sun Jul 27 16:28:34 2008 UTC (16 months ago) by kbahey
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +53 -12 lines
File MIME type: text/x-php
#276874 by jandd, port to Drupal 6.x
1 <?php
2 // $Id: technorati.install,v 1.1 2006/10/28 02:17:35 kbahey Exp $
3
4 /**
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() {
16 $result = drupal_install_schema('technorati');
17
18 if (count($result) > 0) {
19 drupal_set_message(t('technorati module installed.'));
20 }
21 else {
22 drupal_set_message(t('technorati table creation failed. Please "uninstall" the module and retry.'));
23 }
24 }
25
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 }

  ViewVC Help
Powered by ViewVC 1.1.2