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

Contents of /contributions/modules/uc_node_access/uc_node_access.install

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


Revision 1.1 - (show annotations) (download) (as text)
Fri Jun 27 18:21:27 2008 UTC (16 months, 4 weeks ago) by rszrama
Branch: MAIN
CVS Tags: DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
File MIME type: text/x-php
Initial commit of UC Node Access; creates a product feature that lets you grant customers access to view nodes through a product purchase.  Includes a handler to integrate UC Node Access with ACL + Content Access.
1 <?php
2 // $Id$
3
4 function uc_node_access_install() {
5 switch ($GLOBALS['db_type']) {
6 case 'mysqli':
7 case 'mysql':
8 db_query("CREATE TABLE {uc_node_access_products} (
9 pfid mediumint(9) NOT NULL,
10 model varchar(255) NULL,
11 access_nid int(10) NOT NULL,
12 access_limit varchar(32) NOT NULL,
13 time_period varchar(255) NOT NULL,
14 end_date varchar(255) NOT NULL,
15 PRIMARY KEY pfid (pfid),
16 KEY model (model)
17 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
18 db_query("CREATE TABLE {uc_node_access_expirations} (
19 uid mediumint(11) NOT NULL,
20 access_nid int(10) NOT NULL,
21 expiration int(11) NOT NULL,
22 KEY uid (uid),
23 KEY access_nid (access_nid)
24 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
25 break;
26 }
27 }
28
29 function uc_node_access_uninstall() {
30 db_query("DROP TABLE IF EXISTS {uc_node_access_products}");
31 db_query("DROP TABLE IF EXISTS {uc_node_access_expirations}");
32 }
33

  ViewVC Help
Powered by ViewVC 1.1.2