summaryrefslogtreecommitdiff
path: root/modules/tag
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-27 21:07:18 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-27 21:07:18 +0000
commitbd15853708ae73ee69220738a061e10d015d7fb9 (patch)
treefacfbd5b08e3cbb8e7fa2b4adf433b54d4c0c5bc /modules/tag
parent0b9fe18a6bf4036a05db7f9479d7b55d3fe5c782 (diff)
This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
Diffstat (limited to 'modules/tag')
-rw-r--r--modules/tag/helpers/tag_event.php8
-rw-r--r--modules/tag/helpers/tag_installer.php8
2 files changed, 8 insertions, 8 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index 47391355..a0c7b159 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)");
+ $dbs->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 54ad52fe..1345cadb 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");
}
}