changeset 107:71de97240799

Add support for urchin file.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 06 Oct 2016 13:43:43 +0300
parents a3b8cd4183e6
children 417cdd9f8864
files example.cfg mgallery.inc.php mgallery.php
diffstat 3 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/example.cfg	Wed Sep 21 10:35:53 2016 +0300
+++ b/example.cfg	Thu Oct 06 13:43:43 2016 +0300
@@ -14,6 +14,8 @@
 css_select           = yes
 css                  = "/mgallery/basic.css"
 album_icon           = "/mgallery/album_sm.png"
+;page_urchin         = "urchin.inc.php"
+
 
 ; Use image from sub-album as album cover image
 cover_images         = yes
--- a/mgallery.inc.php	Wed Sep 21 10:35:53 2016 +0300
+++ b/mgallery.inc.php	Thu Oct 06 13:43:43 2016 +0300
@@ -63,6 +63,7 @@
   "page_info"        => array(MG_STR, "<b>MGallery ".$mgProgVersion."</b> &copy; Copyright ".$mgProgCopyright),
   "css_select"       => array(MG_BOOL, FALSE),
   "css"              => array(MG_STR, NULL),
+  "urchin_file"      => array(MG_STR, FALSE),
   "album_icon"       => array(MG_STR, "album_sm.png"),
 
   "image_flags"      => array(MG_FLAGS, MGF_JAVASCRIPT | MGF_BREADCRUMBS),
--- a/mgallery.php	Wed Sep 21 10:35:53 2016 +0300
+++ b/mgallery.php	Thu Oct 06 13:43:43 2016 +0300
@@ -140,17 +140,12 @@
   "</head>\n".
   "<body>\n";
 
-/*
-  if (isset($pageUrchin) && file_exists($pageUrchin))
+  if ($pageUrchin !== FALSE && file_exists($pageUrchin))
     require_once $pageUrchin;
-  else
-  if (file_exists("urchin.inc.php"))
-    require_once "urchin.inc.php";
-*/
 
-  echo "<div id=\"messageBox\"></div>\n";
-
-  echo "<div id=\"contents\">\n";
+  echo
+    "<div id=\"messageBox\"></div>\n".
+    "<div id=\"contents\">\n";
 }
 
 
@@ -473,6 +468,7 @@
 
 $pageCSS = mgGetSetting("css");
 $pageCSSSelect = mgGetSetting("css_select");
+$pageUrchin = mgGetSetting("urchin_file");
 $galBasePath = mgGetSetting("base_path");
 $galBaseURL = mgGetSetting("base_url");
 $galImageURL = mgGetSetting("image_url", mgGetSetting("base_url"));