diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-28 06:37:28 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-28 06:37:28 +0000 |
commit | c04ff8e02f01691dc2e325efc523e43f3aebaf95 (patch) | |
tree | 8fbdfe90c1bb04b9b8b74500904c09f126430e19 /modules/tag/helpers | |
parent | ad56995bafffeca89c44b07cb4f25da7b36a1a99 (diff) |
Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r-- | modules/tag/helpers/tag_event.php | 8 | ||||
-rw-r--r-- | modules/tag/helpers/tag_installer.php | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 5604cb50..c0f6b9d7 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -50,10 +50,10 @@ class tag_event_Core { static function item_before_delete($item) { $db = Database::instance(); - $db->query("UPDATE `[tags]` SET `count` = `count` - 1 WHERE `count` > 0 " . - "AND `id` IN (SELECT `tag_id` from `[items_tags]` WHERE `item_id` = $item->id)"); - $db->query("DELETE FROM `[tags]` WHERE `count` = 0 AND `id` IN (" . - "SELECT `tag_id` from `[items_tags]` WHERE `item_id` = $item->id)"); + $db->query("UPDATE {tags} SET `count` = `count` - 1 WHERE `count` > 0 " . + "AND `id` IN (SELECT `tag_id` from {items_tags} WHERE `item_id` = $item->id)"); + $db->query("DELETE FROM {tags} WHERE `count` = 0 AND `id` IN (" . + "SELECT `tag_id` from {items_tags} WHERE `item_id` = $item->id)"); $db->delete("items_tags", array("item_id" => "$item->id")); } diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php index 1345cadb..693551d0 100644 --- a/modules/tag/helpers/tag_installer.php +++ b/modules/tag/helpers/tag_installer.php @@ -22,7 +22,7 @@ class tag_installer { $db = Database::instance(); $version = module::get_version("tag"); if ($version == 0) { - $db->query("CREATE TABLE IF NOT EXISTS `[tags]` ( + $db->query("CREATE TABLE IF NOT EXISTS {tags} ( `id` int(9) NOT NULL auto_increment, `name` varchar(64) NOT NULL, `count` int(10) unsigned NOT NULL DEFAULT 0, @@ -30,7 +30,7 @@ class tag_installer { UNIQUE KEY(`name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - $db->query("CREATE TABLE IF NOT EXISTS `[items_tags]` ( + $db->query("CREATE TABLE IF NOT EXISTS {items_tags} ( `id` int(9) NOT NULL auto_increment, `item_id` int(9) NOT NULL, `tag_id` int(9) NOT NULL, @@ -44,8 +44,8 @@ class tag_installer { static function uninstall() { $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS `[tags]`;"); - $db->query("DROP TABLE IF EXISTS `[items_tags]`;"); + $db->query("DROP TABLE IF EXISTS {tags};"); + $db->query("DROP TABLE IF EXISTS {items_tags};"); module::delete("tag"); } } |