From ac3bef5deaf7edea21f00143524f2ab59ba8cadf Mon Sep 17 00:00:00 2001 From: Banana Date: Thu, 3 Oct 2019 17:45:25 +0200 Subject: [PATCH] some small cleanups and working linkage to tags and category overview --- webroot/lib/link.class.php | 9 +++++---- webroot/view/editcategories.php | 2 ++ webroot/view/edittags.php | 2 ++ webroot/view/home.php | 9 ++------- webroot/view/linkinfo.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/webroot/lib/link.class.php b/webroot/lib/link.class.php index 8cecbf4..f3d2419 100644 --- a/webroot/lib/link.class.php +++ b/webroot/lib/link.class.php @@ -244,14 +244,14 @@ class Link { if(!empty($this->_data['hash'])) { $queryStr = "SELECT - DISTINCT(tag) as tag + DISTINCT tag, tagId FROM `".DB_PREFIX."_combined` WHERE `hash` = '".$this->DB->real_escape_string($this->_data['hash'])."'"; $query = $this->DB->query($queryStr); if(!empty($query) && $query->num_rows > 0) { while($result = $query->fetch_assoc()) { if($result['tag'] !== NULL) { - $ret[$result['tag']] = $result['tag']; + $ret[$result['tagId']] = $result['tag']; } } @@ -270,13 +270,14 @@ class Link { if(!empty($this->_data['hash'])) { $queryStr = "SELECT - DISTINCT(category) FROM `".DB_PREFIX."_combined` + DISTINCT category, categoryId + FROM `".DB_PREFIX."_combined` WHERE `hash` = '".$this->DB->real_escape_string($this->_data['hash'])."'"; $query = $this->DB->query($queryStr); if(!empty($query) && $query->num_rows > 0) { while($result = $query->fetch_assoc()) { if($result['category'] !== NULL) { - $ret[$result['category']] = $result['category']; + $ret[$result['categoryId']] = $result['category']; } } } diff --git a/webroot/view/editcategories.php b/webroot/view/editcategories.php index d8dbca5..5289eea 100644 --- a/webroot/view/editcategories.php +++ b/webroot/view/editcategories.php @@ -48,6 +48,8 @@

+

+

diff --git a/webroot/view/edittags.php b/webroot/view/edittags.php index 5c31193..864799c 100644 --- a/webroot/view/edittags.php +++ b/webroot/view/edittags.php @@ -48,6 +48,8 @@

+

+

diff --git a/webroot/view/home.php b/webroot/view/home.php index 81bc049..48e7776 100644 --- a/webroot/view/home.php +++ b/webroot/view/home.php @@ -206,14 +206,9 @@

Last added

-
+
-
-
- - x -
-
+
diff --git a/webroot/view/linkinfo.php b/webroot/view/linkinfo.php index c728139..ad423bd 100644 --- a/webroot/view/linkinfo.php +++ b/webroot/view/linkinfo.php @@ -147,7 +147,7 @@ - edit + Edit
-- 2.39.5