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

Contents of /contributions/modules/upcomingorg/upcomingorg.install

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


Revision 1.1 - (show annotations) (download) (as text)
Tue Mar 20 00:36:49 2007 UTC (2 years, 8 months ago) by karens
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
A first pass at getting the module updated for Drupal 4.7 and 5.x code changes and for changes in the Upcoming.org API. The module was written in mid-2005 and never updated, so there are lots of changes needed. Not yet tested and debugged, not ready for production.
1 <?php
2 function upcomingorg_install() {
3 drupal_set_message('Installing the Upcoming.org module');
4 switch ($GLOBALS['db_type']) {
5 case 'mysql':
6 case 'mysqli':
7 db_query("
8 CREATE TABLE upcomingorg_category (
9 category_id INT UNSIGNED NOT NULL,
10 name VARCHAR(250) NOT NULL,
11 description TEXT,
12 PRIMARY KEY (category_id)
13 ) /*!40100 DEFAULT CHARACTER SET utf8 */;
14 ");
15 db_query("
16 CREATE TABLE upcomingorg_event (
17 nid int(10) unsigned NOT NULL default '0',
18 event_id int(10) unsigned default NULL,
19 metro_id int(10) unsigned default NULL,
20 venue_nid int(10) unsigned default NULL,
21 user_id int(10) unsigned default NULL,
22 category_id int(10) unsigned default NULL,
23 description text,
24 tags text,
25 personal tinyint(1) unsigned NOT NULL default '0',
26 selfpromotion tinyint(1) unsigned NOT NULL default '0',
27 is_imported tinyint(1) unsigned NOT NULL default '0',
28 PRIMARY KEY (nid)
29 ) /*!40100 DEFAULT CHARACTER SET utf8 */;
30 ");
31 db_query("
32 CREATE TABLE upcomingorg_user (
33 uid int(10) unsigned NOT NULL default '0',
34 upcomingorg_rest_url varchar(200) NOT NULL default '',
35 user_id int(10) unsigned NOT NULL default '0',
36 upcomingorg_token varchar(50) NOT NULL default '',
37 PRIMARY KEY (uid)
38 ) /*!40100 DEFAULT CHARACTER SET utf8 */;
39 ");
40 db_query("
41 CREATE TABLE upcomingorg_venue (
42 nid int(10) unsigned NOT NULL default '0',
43 venue_id int(10) unsigned NOT NULL default '0',
44 metro_id int(10) unsigned NOT NULL default '0',
45 user_id int(10) unsigned NOT NULL default '0',
46 description text,
47 url varchar(250) default NULL,
48 phone varchar(50) default NULL,
49 private tinyint(1) unsigned NOT NULL default '0',
50 is_imported tinyint(1) unsigned NOT NULL default '0',
51 PRIMARY KEY (nid)
52 ) /*!40100 DEFAULT CHARACTER SET utf8 */;
53 ");
54 $success = TRUE;
55 break;
56 case 'pgsql':
57 // TODO add postgres code here
58 //$success = TRUE;
59 break;
60 default:
61 break;
62 } // End case
63
64 if ($success) {
65 drupal_set_message(t('The Upcoming.org module installed tables successfully.'));
66 }
67 else {
68 drupal_set_message(t('The installation of the Upcoming.org module was unsuccessful.'), 'error');
69 }
70 }

  ViewVC Help
Powered by ViewVC 1.1.2