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

Contents of /contributions/modules/leech/leech.install

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


Revision 1.4 - (show annotations) (download) (as text)
Fri Jan 5 00:05:29 2007 UTC (2 years, 10 months ago) by alexb
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
Changes since 1.3: +38 -2 lines
File MIME type: text/x-php
merged DRUPAL-4-7--1-4-before-merge into trunk
1 <?php
2 /* $Id: leech.install,v 1.3.2.3 2006/12/15 19:38:51 alexb Exp $ */
3
4 function leech_install() {
5 switch ($GLOBALS['db_type']) {
6 case 'mysqli':
7 case 'mysql':
8 db_query("CREATE TABLE {leech} (
9 `nid` int(10) NOT NULL default '0',
10 `url` text NOT NULL default '',
11 `refresh` int(10) NOT NULL default '0',
12 `checked` int(10) NOT NULL default '0',
13 `modified` int(10) NOT NULL default '0',
14 `etag` varchar(255) NOT NULL default '',
15 `mime` varchar(255) NOT NULL default '',
16 PRIMARY KEY (`nid`),
17 UNIQUE KEY `url` (`url`(255))
18 );");
19 db_query("CREATE TABLE {leech_news_feed} (
20 `nid` int(10) NOT NULL,
21 `template` int(10) NOT NULL,
22 `logo` varchar(255) NOT NULL default '',
23 `link` text NOT NULL default '',
24 `author` varchar(64) NOT NULL default '',
25 `items_guid` tinyint(2) NOT NULL default '0',
26 `items_status` tinyint(2) NOT NULL default '0',
27 `items_update` tinyint(2) NOT NULL default '0',
28 `items_delete` int(10) NOT NULL default '1000000000',
29 `items_promote` int(10) NOT NULL default '1000000000',
30 `items_date` tinyint(2) NOT NULL default '0',
31 `links_display_mode` tinyint(3) unsigned NOT NULL default '0',
32 PRIMARY KEY (`nid`)
33 );");
34
35 db_query("CREATE TABLE {leech_news_item} (
36 `nid` int(10) NOT NULL default '0',
37 `fid` int(10) unsigned NOT NULL default '0',
38 `link` text NOT NULL default '',
39 `author` varchar(60) NOT NULL default '',
40 `guid` varchar(255) NOT NULL default '',
41 `source_link` varchar(255) NOT NULL default '',
42 `source_xml` varchar(255) NOT NULL default '',
43 `source_title` varchar(128) NOT NULL default '',
44 PRIMARY KEY (`nid`),
45 KEY `fid` (`fid`),
46 KEY `link` (`link`(255)),
47 KEY `guid` (`guid`)
48 );");
49
50 db_query("CREATE TABLE {leech_opml} (
51 `nid` int(10) NOT NULL,
52 `template` int(10) NOT NULL,
53 PRIMARY KEY (`nid`)
54 );");
55
56 $success = TRUE;
57 break;
58 case 'pgsql':
59
60 break;
61 default:
62 break;
63 } // End case
64
65 if ($success) {
66 drupal_set_message(t('Leech module installed tables successfully.'));
67 }
68 else {
69 drupal_set_message(t('The installation of Leech module was unsuccessful.'), 'error');
70 }
71 }

  ViewVC Help
Powered by ViewVC 1.1.2