changeset 38:3f16beb79f9e

Add image title string to certain images.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 03 May 2016 13:44:51 +0300
parents 99dc0843d7df
children c1188641c5b7
files mgallery.php
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mgallery.php	Tue May 03 13:44:13 2016 +0300
+++ b/mgallery.php	Tue May 03 13:44:51 2016 +0300
@@ -10,6 +10,14 @@
 //
 // Various utility functions
 //
+function mgGetImageTitleStr($filename, &$data)
+{
+  return
+    chentities($filename).
+    mgGetArr($data, "datetime", " - %1", "", "mgTimeStr");
+}
+
+
 function mgGetImageURL()
 {
   global $galImageURL, $galPath;
@@ -157,7 +165,8 @@
     if ($data["type"] == 0)
     {
       echo
-      "    <div class=\"imageBox\"><a href=\"".mgGetURL($galPath, $filename)."\">".
+      "    <div class=\"imageBox\" title=\"".mgGetImageTitleStr($filename, $data).
+      "\"><a href=\"".mgGetURL($galPath, $filename)."\">".
       "<img src=\"".mgGetImageURL($galTNPath, $filename)."\" alt=\"".
       chentities($filename)."\"></a></div>\n".
       mgGetArr($data, "caption", "    <div class=\"imageCaption\">%1</div>\n", "", "chentities");