| 1 |
<?php
|
| 2 |
// $Id: comment_og.install,v 1.2 2008/03/31 20:14:23 rapsli Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function comment_og_install() {
|
| 8 |
switch ($GLOBALS['db_type']) {
|
| 9 |
case 'mysql':
|
| 10 |
case 'mysqli':
|
| 11 |
$status[] = db_query("
|
| 12 |
CREATE TABLE {comment_og} (
|
| 13 |
`cid` int(20) NOT NULL,
|
| 14 |
`visibility` int(10) NOT NULL,
|
| 15 |
`ogs` text NOT NULL,
|
| 16 |
PRIMARY KEY (`cid`)
|
| 17 |
) DEFAULT CHARSET=latin1;");
|
| 18 |
break;
|
| 19 |
|
| 20 |
}
|
| 21 |
|
| 22 |
// If there is one FALSE value in the status array, there was an error.
|
| 23 |
if (array_search(FALSE, $status) !== FALSE) {
|
| 24 |
drupal_set_message(t('Table installation for the comment_og module was unsuccessful. The tables may need to be installed by hand.'), 'error');
|
| 25 |
}
|
| 26 |
else {
|
| 27 |
drupal_set_message(t('comment_og module installed successfully.'));
|
| 28 |
}
|
| 29 |
}
|
| 30 |
|
| 31 |
function comment_og_uninstall() {
|
| 32 |
db_query('DROP TABLE {comment_og}');
|
| 33 |
}
|