diff mgallery.php @ 235:028291a78acb

Get rid of the "use tables" option.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 27 Mar 2018 15:12:02 +0300
parents e618280253ca
children 80cbbdc3f14d
line wrap: on
line diff
--- a/mgallery.php	Tue Mar 27 11:34:26 2018 +0300
+++ b/mgallery.php	Tue Mar 27 15:12:02 2018 +0300
@@ -268,7 +268,7 @@
 
 function mgPrintTable($class, &$galEntries, &$galIndex, $start, $limit)
 {
-  global $galAlbumIcon, $galPath, $galTNPath, $galImageURL, $galUseCoverImages, $galUseTables;
+  global $galAlbumIcon, $galPath, $galTNPath, $galImageURL, $galUseCoverImages;
 
   $galCount = count($galIndex);
   if ($start >= $galCount)
@@ -277,22 +277,14 @@
   $end = ($limit === FALSE) ? $galCount : $start + $limit;
   if ($end > $galCount) $end = $galCount;
 
-  $rowLimit = mgGetSetting("album_row_limit");
-  $n = 0;
-
-  echo "<".($galUseTables ? "table" : "div")." class=\"galleryTable ".$class."\">\n";
+  echo "<div class=\"galleryTable ".$class."\">\n";
 
   for ($index = $start; $index < $end; $index++)
   {
     $filename = &$galIndex[$index];
     $data = &$galEntries[$filename];
 
-    if ($galUseTables && $n == 0) echo " <tr>\n";
-
-    if ($galUseTables)
-      echo "  <td class=\"galleryEntry\" id=\"cd".$data["base"]."\">\n";
-    else
-      echo "  <div class=\"galleryEntry\">\n";
+    echo "  <div class=\"galleryEntry\">\n";
 
     if ($data["type"] == 0)
     {
@@ -350,34 +342,10 @@
         "</div></a>\n";
     }
 
-    if ($galUseTables)
-    {
-      echo "  </td>\n";
-      if (++$n >= $rowLimit)
-      {
-        echo " </tr>\n";
-        $n = 0;
-      }
-    }
-    else
-      echo "  </div>\n";
+    echo "  </div>\n";
   }
 
-  if ($galUseTables)
-  {
-    if ($n > 0)
-    {
-      while ($n++ < $rowLimit)
-        echo "  <td></td>\n";
-      echo " </tr>\n";
-    }
-    echo "</table>\n";
-  }
-  else
-  {
-    echo "</div>\n";
-  }
-
+  echo "</div>\n";
   return $index;
 }
 
@@ -485,7 +453,6 @@
 $galImageURL = mgGetSetting("image_url", mgGetSetting("base_url"));
 
 $galUseCoverImages = mgGetSetting("cover_images");
-$galUseTables = mgGetSetting("use_tables");
 
 $galAlbumIcon = mgGetSetting("album_icon");
 $galCleanURLS = mgGetSetting("clean_urls");
@@ -525,17 +492,6 @@
 }
 
 
-// Check "tables" setting
-if (isset($_REQUEST["tables"]))
-{
-  $galUseTables = mgGetRequestItem("tables", FALSE, TRUE);
-  mgSetCookie("mgtables", $galUseTables ? 1 : 0);
-}
-else
-if (isset($_COOKIE["mgtables"]))
-  $galUseTables = intval($_COOKIE["mgtables"]);
-
-
 //
 // Attempt to read the data cache file
 //