From: Banana Date: Tue, 21 Nov 2023 11:29:44 +0000 (+0100) Subject: new home layout X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=f6c9c8e3c4595fe3f62b80e1a1a4b7f0a5e25c53;p=insipid.git new home layout --- diff --git a/ChangeLog b/ChangeLog index 2f61263..e6819ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ version 2.x.x - Griffin Chapel () + Better logging + + New home screen layout version 2.8.2 - Dragon Chapel (2023-09-14) diff --git a/webroot/asset/css/style.css b/webroot/asset/css/style.css index b8e872d..38b7cf7 100644 --- a/webroot/asset/css/style.css +++ b/webroot/asset/css/style.css @@ -26,6 +26,10 @@ h4 a { border-top: 1px solid #cccccc; } +.ddTags:not(:last-child) { + margin-bottom: inherit; +} + /* overwrites */ .section { padding-top: 1.5rem; diff --git a/webroot/lib/link.class.php b/webroot/lib/link.class.php index e15e17e..8b8a0fd 100644 --- a/webroot/lib/link.class.php +++ b/webroot/lib/link.class.php @@ -125,6 +125,8 @@ class Link { # add stuff $this->_image(); + $this->_tags(); + $this->_categories(); } } catch (Exception $e) { Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage()); @@ -147,6 +149,8 @@ class Link { && isset($data['title']) && isset($data['hash']) && isset($data['description']) && isset($data['image'])) { $this->_data = $data; $this->_image(); + $this->_tags(); + $this->_categories(); } return $this->_data; diff --git a/webroot/lib/management.class.php b/webroot/lib/management.class.php index 315638b..25ed197 100644 --- a/webroot/lib/management.class.php +++ b/webroot/lib/management.class.php @@ -231,7 +231,7 @@ class Management { public function latestLinks(string $limit="5"): array { $ret = array(); - $queryStr = "SELECT `title`, `link` FROM `".DB_PREFIX."_link` AS t"; + $queryStr = "SELECT `hash` FROM `".DB_PREFIX."_link` AS t"; $queryStr .= " WHERE ".$this->_decideLinkTypeForQuery(); $queryStr .= " ORDER BY `created` DESC"; if(!empty($limit)) { @@ -243,7 +243,11 @@ class Management { try { $query = $this->DB->query($queryStr); if(!empty($query) && $query->num_rows > 0) { - $ret = $query->fetch_all(MYSQLI_ASSOC); + while($result = $query->fetch_assoc()) { + $linkObj = new Link($this->DB); + $ret[] = $linkObj->loadShortInfo($result['hash']); + + } } } catch (Exception $e) { Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage()); @@ -699,7 +703,6 @@ class Management { return $ret; } - /** * amount of tags * diff --git a/webroot/view/home.inc.php b/webroot/view/home.inc.php index fddd3a0..6c98c23 100644 --- a/webroot/view/home.inc.php +++ b/webroot/view/home.inc.php @@ -186,5 +186,4 @@ if($showAddForm === true) { $existingCategories = $Management->categories(); $existingTags = $Management->tags(); } -$latestLinks = $Management->latestLinks(20); -$orderedCategories = $Management->categoriesByDateAdded(); +$latestLinks = $Management->latestLinks(50); diff --git a/webroot/view/home.php b/webroot/view/home.php index c3dc13c..5c830c6 100644 --- a/webroot/view/home.php +++ b/webroot/view/home.php @@ -231,38 +231,24 @@

t('home.last.added'); ?>

-
+
- +
+ + +
+
+ $tname) { + echo ''.$tname.''; + } ?> + $cname) { + echo ''.$cname.''; + } ?> +
-
- -
- - - - - -
-
-$v) { - $links = $Management->linksByCategory($v['id']); -?> -
-
-

-
    - -
  • + -
-