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

Contents of /contributions/modules/flag_friend/flag_friend.install

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


Revision 1.6 - (show annotations) (download) (as text)
Fri Nov 21 23:25:08 2008 UTC (12 months ago) by sirkitree
Branch: MAIN
CVS Tags: DRUPAL-5--1-1, DRUPAL-5--1-0, HEAD
Changes since 1.5: +0 -0 lines
File MIME type: text/x-php
- creating a persistent set message for friend notification
1 <?php
2 //$Id$
3
4 /**
5 * Implementation of hook_install().
6 */
7 function flag_friend_install() {
8 drupal_set_message(t('Beginning installation of the flag_friend Module.'));
9 switch($GLOBALS['db_type']) {
10 case 'mysql': // use same as mysqli
11 case 'mysqli':
12 db_query("CREATE TABLE IF NOT EXISTS {flag_friend} (
13 uid int(10) unsigned NOT NULL,
14 friend_uid int(10) unsigned NOT NULL,
15 created int(11) default NULL,
16 PRIMARY KEY(uid, friend_uid)
17 ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
18
19 db_query("CREATE TABLE IF NOT EXISTS {flag_friend_message} (
20 fcid smallint unsigned NOT NULL default '0',
21 message text NOT NULL,
22 PRIMARY KEY(fcid)
23 ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
24
25 $success = TRUE;
26 break;
27 }
28 if ($success) {
29 drupal_set_message(t('The flag_friend module installed its tables successfully.'));
30 }
31 else {
32 drupal_set_message(t('The installation of the flag_friend module got borked, yo.'), 'error');
33 }
34 }
35
36 /**
37 * Implementation of hook_uninstall().
38 */
39 function flag_friend_uninstall() {
40 db_query("DROP TABLE {flag_friend}");
41 db_query("DROP TABLE {flag_friend_message}");
42 drupal_set_message(t('flag_friend module successfully uninstalled.'));
43 }

  ViewVC Help
Powered by ViewVC 1.1.2