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

Contents of /contributions/modules/knurl/knurl.install

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


Revision 1.1 - (show annotations) (download) (as text)
Tue Dec 18 22:01:39 2007 UTC (23 months, 1 week ago) by splacette
Branch: MAIN
CVS Tags: DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
File MIME type: text/x-php
Committing Knurl, a module that provides a URL shortcut and redirection service similar to TinyURL or TightURL.  This module contains source code from the TightURL project (http://www.tighturl.com/project) and the Horde project (www.horde.org).
1 <?php
2 // $Id$
3
4
5 /**
6 * Implementation of hook_install().
7 */
8 function knurl_install() {
9 switch ($GLOBALS['db_type']) {
10 case 'mysql':
11 case 'mysqli':
12 db_query("CREATE TABLE {knurl} (
13 tid int(11) auto_increment, -- knurl id
14 uid int(11) unsigned NOT NULL default 0, -- knurl user id
15 short_url varchar(255) NOT NULL,
16 link text NOT NULL,
17 PRIMARY KEY (tid),
18 KEY short_url (short_url)
19 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
20 break;
21 default:
22 die("Schema for " . $GLOBALS['db_type'] . " not implemented!");
23 }
24 }
25
26 /**
27 * Implementation of hook_uninstall().
28 */
29 function knurl_uninstall() {
30 db_query('DROP TABLE {knurl}');
31 }

  ViewVC Help
Powered by ViewVC 1.1.2