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

Contents of /contributions/modules/autoresponder/autoresponder.install

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


Revision 1.2 - (show annotations) (download) (as text)
Tue May 1 19:12:12 2007 UTC (2 years, 6 months ago) by antinomia
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--1, DRUPAL-4-7
Changes since 1.1: +21 -1 lines
File MIME type: text/x-php
First pass at update to Drupal 5, moved administrative pages from /admin/autoresponder to /admin/settings/autoresponder.
1 <?php
2
3 $Id$
4
5 /**
6 * Install the database schema
7 */
8 function autoresponder_install() {
9 variable_set('emails_sent', '0');
10 switch($GLOBALS['db_type']) {
11 case 'mysql':
12 case 'mysqli':
13 db_query("CREATE TABLE {autoresponder_users} (
14 id int(11) NOT NULL default '0',
15 email char(50) NOT NULL,
16 reg_date int(11) NOT NULL,
17 PRIMARY KEY (id)
18 );");
19 db_query("CREATE TABLE {autoresponder_messages} (
20 id int(11) NOT NULL default '0',
21 subject char(50) NOT NULL,
22 body text NOT NULL,
23 day int(11) default NULL,
24 mset int(11) default NULL,
25 PRIMARY KEY (id)
26 );");
27 db_query("CREATE TABLE {autoresponder_sets} (
28 id int(11) NOT NULL default '0',
29 name char(50) NOT NULL,
30 active bool NOT NULL,
31 PRIMARY KEY (id)
32 );");
33 db_query("CREATE TABLE {autoresponder} (
34 id int(11) NOT NULL default '0',
35 uid int(11) NOT NULL,
36 setid int(11) NOT NULL,
37 PRIMARY KEY (id)
38 );");
39 drupal_set_message(t("The database schema for the autoresponder module was created."));
40 break;
41 }
42 }
43
44 /**
45 * Uninstall the database schema
46 */
47 function autoresponder_uninstall() {
48 variable_del('emails_sent');
49 switch($GLOBALS['db_type']) {
50 case 'mysql':
51 case 'mysqli':
52 db_query("DROP TABLE {autoresponder_users}");
53 db_query("DROP TABLE {autoresponder_messages}");
54 db_query("DROP TABLE {autoresponder_sets}");
55 db_query("DROP TABLE {autoresponder}");
56 drupal_set_message(t("Autoresponder module successfully uninstalled."));
57 break;
58 }
59 }
60 ?>

  ViewVC Help
Powered by ViewVC 1.1.2