changeset 125:379a8cd3bb2c

Show number of images and sub-galleries on the page title. (I can't figure out a better place for that information at the moment.)
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 26 Aug 2017 03:41:16 +0300
parents eac2cf04261a
children e14605c7aea0
files mgallery.php
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mgallery.php	Mon Jul 31 14:48:09 2017 +0300
+++ b/mgallery.php	Sat Aug 26 03:41:16 2017 +0300
@@ -762,6 +762,16 @@
   //
   $pageTitle = $galTitlePrefix.mgGetArr($galData, "caption", " - %1", "", "chentities");
   mgPrintPageHeader($pageTitle);
+
+  $ptmp = [];
+  if (count($galImagesIndex) > 0)
+    $ptmp[] = count($galImagesIndex)." images";
+  if (count($galAlbumsIndex) > 0)
+    $ptmp[] = count($galAlbumsIndex)." sub-albums";
+
+  if (count($ptmp))
+    $pageTitle .= " (".implode($ptmp, ", ").")";
+
   echo
     mgGetPageInfoHeaderStart().
     "<h1>".$pageTitle."</h1>\n";