summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/controllers/welcome.php9
-rw-r--r--core/views/welcome.html.php8
2 files changed, 16 insertions, 1 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index 4f4f7535..a3e46214 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -47,8 +47,17 @@ class Welcome_Controller extends Template_Controller {
try {
$this->template->tag_count = ORM::factory("tag")->count_all();
+ $this->template->most_tagged = Database::instance()
+ ->select("item_id AS id", "COUNT(tag_id) AS count")
+ ->from("items_tags")
+ ->groupby("item_id")
+ ->orderby("count", "DESC")
+ ->limit(1)
+ ->get()
+ ->current();
} catch (Exception $e) {
$this->template->tag_count = 0;
+ $this->template->most_tagged = 0;
}
set_error_handler($old_handler);
diff --git a/core/views/welcome.html.php b/core/views/welcome.html.php
index 154df8ce..c9277efd 100644
--- a/core/views/welcome.html.php
+++ b/core/views/welcome.html.php
@@ -177,7 +177,7 @@
<div id="actions" class="activity">
<p>
<?= html::anchor("albums/1", "Browse Gallery") ?>
- <i>(<?= $album_count ?> albums, <?= $photo_count ?> photos, <?= $comment_count ?> comments)</i>
+ <i>(<?= $album_count ?> albums, <?= $photo_count ?> photos, <?= $comment_count ?> comments, <?= $tag_count ?> tags)</i>
</p>
<p>
add: [
@@ -231,6 +231,12 @@
<i>(<?= $deepest_photo->level ?> levels deep)</i>
</li>
<? endif ?>
+ <? if ($most_tagged): ?>
+ <li>
+ <?= html::anchor("items/{$most_tagged->id}", "Most tagged item") ?>
+ <i>(<?= $most_tagged->count ?> tags)</i>
+ </li>
+ <? endif ?>
<li> Profiling:
<? if (Session::instance()->get("use_profiler", false)): ?>
<b>on</b> <?= html::anchor("welcome/profiler?use_profiler=0", "off") ?>