From 2931ce209e04b7c9fbb1cd8f9c15197794c64df5 Mon Sep 17 00:00:00 2001 From: Bart Schuurmans Date: Sun, 23 Dec 2012 13:12:45 +0100 Subject: [PATCH] Use $displayname for albums $displayname is the album's $humanname, with a fallback to $name --- index.php | 7 +++++-- templates/footer.tpl | 2 +- templates/index.tpl | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 9b8e858..51b1e21 100644 --- a/index.php +++ b/index.php @@ -18,6 +18,7 @@ $album = ''; $order = 'id DESC'; $humanname = 'Fotoalbum'; + $displayname = $humanname; $parentalbums = array(); } else { $row = getUnitByFullPath(substr($album, 0, -1)); @@ -36,6 +37,7 @@ $id = $row['id']; $visibility = $row['visibility']; $humanname = $row['humanname']; + $displayname = $humanname ?: $row['name']; $order = 'name'; } @@ -94,7 +96,7 @@ $albums[] = array( 'name' => $row['name'], 'fullpath' => $row['path'] . $row['name'], - 'humanname' => $row['humanname'] ? $row['humanname'] : $row['name'] + 'displayname' => $row['humanname'] ?: $row['name'], ); } else { $photos[] = array( @@ -121,10 +123,11 @@ template_assign('parentalbum'); } template_assign('parentalbums'); - template_assign('title', $humanname); // XXX + template_assign('title', $displayname); // XXX template_assign('id'); template_assign('visibility'); template_assign('humanname'); + template_assign('displayname'); // Paging $url = './?album='. urlencode($album) . $extra_params; diff --git a/templates/footer.tpl b/templates/footer.tpl index 7c40358..3643a5a 100644 --- a/templates/footer.tpl +++ b/templates/footer.tpl @@ -6,7 +6,7 @@ diff --git a/templates/index.tpl b/templates/index.tpl index a9d0c58..f66011b 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -8,7 +8,7 @@ - + $page) { ?> @@ -23,7 +23,7 @@ - / + /