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

Contents of /contributions/modules/ilovethis/ilovethis.install

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


Revision 1.1 - (show annotations) (download) (as text)
Thu Nov 15 13:44:55 2007 UTC (2 years ago) by finley
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
Initial commit of ilovethis module. This module allows user to say 'I love this page'.
1 <?php
2 // $Id:
3
4 /**
5 * Implementation of hook_install().
6 */
7 function ilovethis_install() {
8 switch ($GLOBALS['db_type']) {
9 case 'mysql':
10 case 'mysqli':
11 $result = db_query("CREATE TABLE ilovethis (
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('ilovethis module database tables created successfully.'));
26 } else {
27 drupal_set_message(t('ilovethis module database table creation failure. Please view the ilovethis module folder and read the README.txt'), 'error');
28 }
29 }
30
31 /**
32 * Implementation of hook_uninstall().
33 */
34 function ilovethis_uninstall() {
35 db_query('DROP TABLE {ilovethis}');
36 // TODO: need to handle this.
37 //db_query("DELETE FROM {variable} WHERE name LIKE '%ilovethis%'");
38 }

  ViewVC Help
Powered by ViewVC 1.1.2