summaryrefslogtreecommitdiff
path: root/modules/exif/helpers/exif_theme.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/exif/helpers/exif_theme.php')
-rw-r--r--modules/exif/helpers/exif_theme.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/exif/helpers/exif_theme.php b/modules/exif/helpers/exif_theme.php
index 432bca40..0bd113ca 100644
--- a/modules/exif/helpers/exif_theme.php
+++ b/modules/exif/helpers/exif_theme.php
@@ -21,10 +21,13 @@ class exif_theme_Core {
static function sidebar_bottom($theme) {
$item = $theme->item();
if ($item && $item->is_photo()) {
- $exif_count = Database::instance()
- ->count_records("exif_keys", array("item_id" => $item->id));
-
- if (!empty($exif_count)) {
+ if (Database::instance()
+ ->select("key_count")
+ ->from("exif_records")
+ ->where("item_id", $item->id)
+ ->get()
+ ->current()
+ ->key_count) {
$view = new View("exif_sidebar.html");
$view->item = $item;
return $view;