| 1 |
<?php
|
| 2 |
|
| 3 |
function search_block_install() {
|
| 4 |
switch ($GLOBALS['db_type']) {
|
| 5 |
case 'mysqli':
|
| 6 |
case 'mysql':
|
| 7 |
$q1 = db_query("CREATE TABLE IF NOT EXISTS {search_block} (
|
| 8 |
nid int(10) unsigned NOT NULL default '0',
|
| 9 |
enabled BOOL NOT NULL default '0',
|
| 10 |
dirty BOOL NOT NULL default '0',
|
| 11 |
PRIMARY KEY (nid)
|
| 12 |
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 13 |
|
| 14 |
if ($q1) {
|
| 15 |
$created = TRUE;
|
| 16 |
}
|
| 17 |
break;
|
| 18 |
|
| 19 |
case 'pgsql':
|
| 20 |
break;
|
| 21 |
}
|
| 22 |
|
| 23 |
if ($created) {
|
| 24 |
drupal_set_message(t('Search Block module installed successfully.'));
|
| 25 |
}
|
| 26 |
else {
|
| 27 |
drupal_set_message(t('Table installation for the Search Block module was unsuccessful. The tables may need to be installed by hand. See the search_block.install file for a list of the installation queries.'), 'error');
|
| 28 |
}
|
| 29 |
}
|