| 1 |
<?php
|
| 2 |
|
| 3 |
function user_tags_install() {
|
| 4 |
drupal_set_message('Installing user_tags.....');
|
| 5 |
switch ($GLOBALS['db_type']) {
|
| 6 |
case 'mysql':
|
| 7 |
case 'mysqli':
|
| 8 |
$query1 = db_query("CREATE TABLE {term_user} (
|
| 9 |
vid int(10) unsigned NOT NULL default '0',
|
| 10 |
tid int(10) unsigned NOT NULL default '0',
|
| 11 |
uid int(10) unsigned NOT NULL default '0'
|
| 12 |
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 13 |
|
| 14 |
$query2 = db_query("CREATE TABLE {user_tags_vocabulary} (
|
| 15 |
vid INT NOT NULL
|
| 16 |
) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
|
| 17 |
|
| 18 |
if ($query1 && $query2) {
|
| 19 |
$success = TRUE;
|
| 20 |
}
|
| 21 |
break;
|
| 22 |
}
|
| 23 |
|
| 24 |
//if all the tables were installed give confirmation, otherwise display error.
|
| 25 |
if ($success) {
|
| 26 |
drupal_set_message(t("user_tags module installed successfully."));
|
| 27 |
}
|
| 28 |
else {
|
| 29 |
drupal_set_message(t("user_tags module was not installed. Please view the user_tags module folder and read the INSTALL.txt"), 'error');
|
| 30 |
}
|
| 31 |
}
|