From e0721fdecb9eea2ac582193e4ff3a6d3488746a6 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Wed, 30 Nov 2022 21:54:14 +0100 Subject: [PATCH] fix tables names --- _init.php | 20 ++++++++++++++++++++ _install.php | 2 +- inc/class.zcfs.feedsactions.php | 2 +- inc/class.zoneclear.feed.server.php | 10 +++++----- 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 _init.php diff --git a/_init.php b/_init.php new file mode 100644 index 0000000..08fb0e0 --- /dev/null +++ b/_init.php @@ -0,0 +1,20 @@ +con, dcCore::app()->prefix); - $t->zc_feed + $t->{initZoneclearFeedServer::FEED_TABLE_NAME} ->feed_id('bigint', 0, false) ->feed_creadt('timestamp', 0, false, 'now()') ->feed_upddt('timestamp', 0, false, 'now()') diff --git a/inc/class.zcfs.feedsactions.php b/inc/class.zcfs.feedsactions.php index 5160a32..5e8723e 100644 --- a/inc/class.zcfs.feedsactions.php +++ b/inc/class.zcfs.feedsactions.php @@ -75,7 +75,7 @@ class zcfsFeedsActionsPage extends dcActions $this->rs = $feeds; } else { $this->rs = dcCore::app()->con->select( - 'SELECT blog_id FROM ' . dcCore::app()->prefix . 'blog WHERE false' + 'SELECT blog_id FROM ' . dcCore::app()->prefix . dcBlog::BLOG_TABLE_NAME . ' WHERE false' ); } } diff --git a/inc/class.zoneclear.feed.server.php b/inc/class.zoneclear.feed.server.php index fa3309e..d465afc 100644 --- a/inc/class.zoneclear.feed.server.php +++ b/inc/class.zoneclear.feed.server.php @@ -38,7 +38,7 @@ class zoneclearFeedServer { $this->con = dcCore::app()->con; $this->blog = dcCore::app()->con->escape(dcCore::app()->blog->id); - $this->table = dcCore::app()->prefix . 'zc_feed'; + $this->table = dcCore::app()->prefix . initZoneclearFeedServer::FEED_TABLE_NAME; } /** @@ -247,7 +247,7 @@ class zoneclearFeedServer } $strReq .= 'FROM ' . $this->table . ' Z ' . - 'LEFT OUTER JOIN ' . dcCore::app()->prefix . 'category C ON Z.cat_id = C.cat_id '; + 'LEFT OUTER JOIN ' . dcCore::app()->prefix . dcCategories::CATEGORY_TABLE_NAME . ' C ON Z.cat_id = C.cat_id '; if (!empty($params['from'])) { $strReq .= $params['from'] . ' '; @@ -837,7 +837,7 @@ class zoneclearFeedServer # Get super admins $rs = $this->con->select( 'SELECT user_id, user_super, user_name, user_firstname, user_displayname ' . - 'FROM ' . $this->con->escapeSystem(dcCore::app()->prefix . 'user') . ' ' . + 'FROM ' . $this->con->escapeSystem(dcCore::app()->prefix . dcCategories::CATEGORY_TABLE_NAME) . ' ' . 'WHERE user_super = 1 AND user_status = 1 ' ); @@ -856,8 +856,8 @@ class zoneclearFeedServer # Get admins $rs = $this->con->select( 'SELECT U.user_id, U.user_super, U.user_name, U.user_firstname, U.user_displayname ' . - 'FROM ' . $this->con->escapeSystem(dcCore::app()->prefix . 'user') . ' U ' . - 'LEFT JOIN ' . $this->con->escapeSystem(dcCore::app()->prefix . 'permissions') . ' P ' . + 'FROM ' . $this->con->escapeSystem(dcCore::app()->prefix . dcCategories::CATEGORY_TABLE_NAME) . ' U ' . + 'LEFT JOIN ' . $this->con->escapeSystem(dcCore::app()->prefix . dcAuth::PERMISSIONS_TABLE_NAME) . ' P ' . 'ON U.user_id=P.user_id ' . 'WHERE U.user_status = 1 ' . "AND P.blog_id = '" . $this->blog . "' " .