return $ret;
}
+ /**
+ * amount of links in the DB. Status 1 and 2 only
+ * @return int
+ */
+ public function linkAmount() {
+ $ret = 0;
+
+ $queryStr = "SELECT COUNT(*) AS amount FROM `".DB_PREFIX."_link`";
+ if($this->_showPrivate === true) {
+ $queryStr .= " WHERE `status` IN (2,1)";
+ }
+ else {
+ $queryStr .= " WHERE `status` = 2";
+ }
+
+ $query = $this->DB->query($queryStr);
+ if(!empty($query) && $query->num_rows > 0) {
+ $result = $query->fetch_assoc();
+ $ret = $result['amount'];
+ }
+
+ return $ret;
+ }
+
+
+ /**
+ * amount of tags
+ * @return int
+ */
+ public function tagAmount() {
+ $ret = 0;
+
+ $queryStr = "SELECT COUNT(*) AS amount FROM `".DB_PREFIX."_tag`";
+
+ $query = $this->DB->query($queryStr);
+ if(!empty($query) && $query->num_rows > 0) {
+ $result = $query->fetch_assoc();
+ $ret = $result['amount'];
+ }
+
+ return $ret;
+ }
+
+ /**
+ * amount of categories
+ * @return int
+ */
+ public function categoryAmount() {
+ $ret = 0;
+
+ $queryStr = "SELECT COUNT(*) AS amount FROM `".DB_PREFIX."_category`";
+
+ $query = $this->DB->query($queryStr);
+ if(!empty($query) && $query->num_rows > 0) {
+ $result = $query->fetch_assoc();
+ $ret = $result['amount'];
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Amount of links need moderation
+ * @return int
+ */
+ public function moderationAmount() {
+ $ret = 0;
+
+ $queryStr = "SELECT COUNT(*) AS amount FROM `".DB_PREFIX."_link`";
+ $queryStr .= " WHERE `status` = 3";
+
+ $query = $this->DB->query($queryStr);
+ if(!empty($query) && $query->num_rows > 0) {
+ $result = $query->fetch_assoc();
+ $ret = $result['amount'];
+ }
+
+ return $ret;
+ }
+
/**
* for simpler management we have the search data in a separate column
* it is not fancy or even technical nice but it damn works
--- /dev/null
+<?php
+/**
+ * Insipid
+ * Personal web-bookmark-system
+ *
+ * Copyright 2016-2019 Johannes Keßler
+ *
+ * Development starting from 2011: Johannes Keßler
+ * https://www.bananas-playground.net/projekt/insipid/
+ *
+ * creator:
+ * Luke Reeves <luke@neuro-tech.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.
+ *
+ */
+$_displayEditButton = false;
+if(Summoner::simpleAuthCheck() === true) {
+ $_displayEditButton = true;
+ $moderationAmount = $Management->moderationAmount();
+}
+
+$linkAmount = $Management->linkAmount();
+$tagAmount = $Management->tagAmount();
+$categoryAmount = $Management->categoryAmount();
+
--- /dev/null
+<?php
+/**
+ * Insipid
+ * Personal web-bookmark-system
+ *
+ * Copyright 2016-2019 Johannes Keßler
+ *
+ * Development starting from 2011: Johannes Keßler
+ * https://www.bananas-playground.net/projekt/insipid/
+ *
+ * creator:
+ * Luke Reeves <luke@neuro-tech.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.
+ *
+ */
+?>
+<section class="section">
+ <div class="columns">
+ <div class="column">
+ <p class="has-text-right">
+ <a href="index.php?p=overview&m=tag" title="all tags" class="button">
+ <span class="icon"><i class="ion-md-pricetags"></i></span>
+ </a>
+ <a href="index.php?p=overview&m=category" title="all categories" class="button">
+ <span class="icon"><i class="ion-md-filing"></i></span>
+ </a>
+ <a href="index.php" title="... back to home" class="button">
+ <span class="icon"><i class="ion-md-home"></i></span>
+ </a>
+ </p>
+ </div>
+ </div>
+
+ <div class="columns">
+ <div class="column">
+ <h2 class="is-size-2">Stats</h2>
+ </div>
+ </div>
+</section>
+
+<section class="section">
+ <div class="columns">
+ <div class="column">
+ <h3 class="is-size-3">Links</h3>
+ <p># of Links: <?php echo $linkAmount; ?></p>
+ <p><a href="index.php?p=overview&m=all">View all</a></p>
+ </div>
+ <div class="column">
+ <h3 class="is-size-3">Tags</h3>
+ <p># of Tags: <?php echo $tagAmount; ?></p>
+ <p><a href="index.php?p=overview&m=tag">View all</a></p>
+ </div>
+ <div class="column">
+ <h3 class="is-size-3">Categories</h3>
+ <p># of Categories: <?php echo $categoryAmount; ?></p>
+ <p><a href="index.php?p=overview&m=category">View all</a></p>
+ </div>
+ <?php if($_displayEditButton === true) { ?>
+ <div class="column">
+ <h3 class="is-size-3">Moderation</h3>
+ <p># Moderation needed: <?php echo $moderationAmount; ?></p>
+ </div>
+ <?php } ?>
+ </div>
+</section>