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

Contents of /contributions/modules/collect_nodes/collect_nodes.install

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


Revision 1.2 - (show annotations) (download) (as text)
Mon May 26 11:54:11 2008 UTC (18 months ago) by striky2
Branch: MAIN
CVS Tags: DRUPAL-5--2-1, HEAD
Changes since 1.1: +3 -2 lines
File MIME type: text/x-php
Full compliance against coder.module and README.txt
1 <?php
2 // $Id$
3
4 /**
5 * Implementation of hook_install().
6 */
7 function collect_nodes_install() {
8 switch ($GLOBALS['db_type']) {
9 case 'mysql':
10 case 'mysqli':
11 $result = db_query("CREATE TABLE collect_nodes (
12 nid INT NOT NULL,
13 uid INT NOT NULL,
14 last INT,
15 PRIMARY KEY (nid, uid)
16 ) Type=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
17 ");
18 break;
19 case 'pgsql':
20 // TODO: need this
21 break;
22 }
23
24 if ($result) {
25 drupal_set_message(t('collect_nodes module database table created successfully.'));
26 }
27 else {
28 drupal_set_message(t('collect_nodes module database table creation failure. '), 'error');
29 }
30 }
31
32 /**
33 * Implementation of hook_uninstall().
34 */
35 function collect_nodes_uninstall() {
36 db_query('DROP TABLE {collect_nodes}');
37 }

  ViewVC Help
Powered by ViewVC 1.1.2