diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-23 20:31:43 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-23 20:31:43 +0000 |
commit | 02486f2401b072fb3f5f2a50e68afaf2db9368d3 (patch) | |
tree | d1a56e27de877fad568c719c5c610a19ccab4fcd | |
parent | 3e3beb34e953540b81470e4d4e1859c4ecbdf77d (diff) |
Show the # of comments
-rw-r--r-- | core/controllers/welcome.php | 7 | ||||
-rw-r--r-- | core/views/welcome.html.php | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index 80aa2f8c..d8c69f97 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -26,6 +26,7 @@ class Welcome_Controller extends Template_Controller { $this->template->syscheck->modules = array(); $this->template->album_count = 0; $this->template->photo_count = 0; + $this->template->comment_count = 0; $this->template->deepest_photo = null; try { $old_handler = set_error_handler(array("Welcome_Controller", "_error_handler")); @@ -36,6 +37,12 @@ class Welcome_Controller extends Template_Controller { ->where("type", "photo")->orderby("level", "desc")->find(); } catch (Exception $e) { } + + try { + $this->template->comment_count = ORM::factory("comment")->count_all(); + } catch (Exception $e) { + } + set_error_handler($old_handler); $this->_create_directories(); diff --git a/core/views/welcome.html.php b/core/views/welcome.html.php index 41578935..f98ab167 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)</i> + <i>(<?= $album_count ?> albums, <?= $photo_count ?> photos, <?= $comment_count ?> comments)</i> </p> <p> add: [ |