# HG changeset patch # User Matti Hamalainen # Date 1522152722 -10800 # Node ID 028291a78acb863825ff7a33702553dddfacd162 # Parent ca5f13c8f535b217dde77882adc0e1c9d527bf67 Get rid of the "use tables" option. diff -r ca5f13c8f535 -r 028291a78acb basic.css --- a/basic.css Tue Mar 27 11:34:26 2018 +0300 +++ b/basic.css Tue Mar 27 15:12:02 2018 +0300 @@ -144,20 +144,17 @@ width: 100%; background: #454; margin-bottom: 1em; -} - -div.galleryTable { display: flex; flex-wrap: wrap; } -div.galleryEntry { +.galleryEntry { width: 12em; padding: 1em; text-align: center; } -div.galleryEntry img { +.galleryEntry img { width: 100%; } @@ -177,7 +174,7 @@ color: #f00; } -div.galleryTable .galleryEntry { +.galleryTable .galleryEntry { display: inline-block; vertical-align: middle; } @@ -438,7 +435,7 @@ font-size: 1.4em; } - div.galleryEntry { + .galleryEntry { width: 40%; } diff -r ca5f13c8f535 -r 028291a78acb example.cfg --- a/example.cfg Tue Mar 27 11:34:26 2018 +0300 +++ b/example.cfg Tue Mar 27 15:12:02 2018 +0300 @@ -27,11 +27,6 @@ ; If disabled, album_icon will be always used for cover image cover_images = yes -; Use table elements? If disabled, CSS is responsible for formatting -use_tables = yes - -; Number of image entries per table row, if use_tables enabled -album_row_limit = 6 ;;; ;;; Important paths and urls diff -r ca5f13c8f535 -r 028291a78acb mgallery.inc.php --- a/mgallery.inc.php Tue Mar 27 11:34:26 2018 +0300 +++ b/mgallery.inc.php Tue Mar 27 15:12:02 2018 +0300 @@ -70,9 +70,6 @@ "cover_images" => [MG_BOOL, TRUE], "album_icon" => [MG_STR, "album_sm.png"], - "use_tables" => [MG_BOOL, FALSE], - "album_row_limit" => [MG_INT, 5], - "title_prefix" => [MG_STR, ""], "title_sep" => [MG_STR, " - "], "page_info" => [MG_STR, "Powered by MGallery ".$mgProgVersion." © Copyright ".$mgProgCopyright], diff -r ca5f13c8f535 -r 028291a78acb mgallery.php --- 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 "
\n"; for ($index = $start; $index < $end; $index++) { $filename = &$galIndex[$index]; $data = &$galEntries[$filename]; - if ($galUseTables && $n == 0) echo " \n"; - - if ($galUseTables) - echo " \n"; - else - echo "
\n"; + echo "
\n"; if ($data["type"] == 0) { @@ -350,34 +342,10 @@ "
\n"; } - if ($galUseTables) - { - echo " \n"; - if (++$n >= $rowLimit) - { - echo " \n"; - $n = 0; - } - } - else - echo "
\n"; + echo "
\n"; } - if ($galUseTables) - { - if ($n > 0) - { - while ($n++ < $rowLimit) - echo " \n"; - echo " \n"; - } - echo "\n"; - } - else - { - echo "\n"; - } - + echo "\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 //