Mercurial > hg > mgallery
comparison mgallery.php @ 253:5b41efcec87d
More work on webp/etc support implementation.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 12 Dec 2018 13:34:24 +0200 |
parents | f85870271f51 |
children | d536c57fa952 |
comparison
equal
deleted
inserted
replaced
252:f85870271f51 | 253:5b41efcec87d |
---|---|
182 chentities($filename). | 182 chentities($filename). |
183 mgGetArr($data, "datetime", " - %1", "", "mgTimeStr"); | 183 mgGetArr($data, "datetime", " - %1", "", "mgTimeStr"); |
184 } | 184 } |
185 | 185 |
186 | 186 |
187 function mgGetImageURL() | 187 function mgGetImageURL($fpath, $filename, $ffmt) |
188 { | 188 { |
189 global $galImageURL, $galPath; | 189 global $galImageURL, $galPath; |
190 return str_replace("//", "/", $galImageURL.$galPath."/".implode("", func_get_args())); | 190 return str_replace("//", "/", $galImageURL.$galPath."/".$fpath.$filename.".".$ffmt); |
191 } | 191 } |
192 | 192 |
193 | 193 |
194 function mgGetURL($path, $image, $entities = TRUE) | 194 function mgGetURL($path, $image, $entities = TRUE) |
195 { | 195 { |
223 } | 223 } |
224 | 224 |
225 | 225 |
226 function mgGetNaviControlImage(&$galIndex, $index, $class, $url) | 226 function mgGetNaviControlImage(&$galIndex, $index, $class, $url) |
227 { | 227 { |
228 global $galTNPath; | 228 global $galTNPath, $galTNFormat; |
229 | 229 |
230 if ($url !== FALSE) | 230 if ($url !== FALSE) |
231 { | 231 { |
232 return | 232 return |
233 "<div class=\"imageCtrl ".$class."\">". | 233 "<div class=\"imageCtrl ".$class."\">". |
234 "<a href=\"".$url."\"><img src=\"". | 234 "<a href=\"".$url."\"><img src=\"". |
235 mgGetImageURL($galTNPath, $galIndex[$index]). | 235 mgGetImageURL($galTNPath, $galIndex[$index], $galTNFormat). |
236 "\" alt=\"".$galIndex[$index]."\" /></a></div>"; | 236 "\" alt=\"".$galIndex[$index]."\" /></a></div>"; |
237 } | 237 } |
238 else | 238 else |
239 return ""; | 239 return ""; |
240 } | 240 } |
261 } | 261 } |
262 | 262 |
263 | 263 |
264 function mgPrintTable($class, &$galEntries, &$galIndex, $start, $limit) | 264 function mgPrintTable($class, &$galEntries, &$galIndex, $start, $limit) |
265 { | 265 { |
266 global $galAlbumIcon, $galPath, $galTNPath, $galImageURL, $galUseCoverImages; | 266 global $galAlbumIcon, $galPath, $galTNPath, $galTNFormat, |
267 $galImageURL, $galUseCoverImages; | |
267 | 268 |
268 $galCount = count($galIndex); | 269 $galCount = count($galIndex); |
269 if ($start >= $galCount) | 270 if ($start >= $galCount) |
270 return $start; | 271 return $start; |
271 | 272 |
284 if ($data["type"] == 0) | 285 if ($data["type"] == 0) |
285 { | 286 { |
286 echo | 287 echo |
287 " <div class=\"imageBox\" title=\"".mgGetImageTitleStr($filename, $data). | 288 " <div class=\"imageBox\" title=\"".mgGetImageTitleStr($filename, $data). |
288 "\"><a href=\"".mgGetURL($galPath, $filename)."\"><img src=\"". | 289 "\"><a href=\"".mgGetURL($galPath, $filename)."\"><img src=\"". |
289 mgGetImageURL($galTNPath, $filename). | 290 mgGetImageURL($galTNPath, $filename, $galTNFormat). |
290 "\" alt=\"".dhentities($filename)."\"></a></div>\n". | 291 "\" alt=\"".dhentities($filename)."\"></a></div>\n". |
291 mgGetArr($data, "caption", " <div class=\"imageCaption\">%1</div>\n", "", "chentities"); | 292 mgGetArr($data, "caption", " <div class=\"imageCaption\">%1</div>\n", "", "chentities"); |
292 /* | 293 /* |
293 if ($mode == "") | 294 if ($mode == "") |
294 { | 295 { |
453 | 454 |
454 $galAlbumIcon = mgGetSetting("album_icon"); | 455 $galAlbumIcon = mgGetSetting("album_icon"); |
455 $galCleanURLS = mgGetSetting("clean_urls"); | 456 $galCleanURLS = mgGetSetting("clean_urls"); |
456 $galTNPath = mgGetSetting("tn_path"); | 457 $galTNPath = mgGetSetting("tn_path"); |
457 $galMedPath = mgGetSetting("med_path"); | 458 $galMedPath = mgGetSetting("med_path"); |
459 $galTNFormat = mgGetSetting("tn_format"); | |
460 $galMedFormat = mgGetSetting("med_format"); | |
458 $galTitlePrefix = mgGetSetting("title_prefix"); | 461 $galTitlePrefix = mgGetSetting("title_prefix"); |
459 $galTitleSep = mgGetSetting("title_sep"); | 462 $galTitleSep = mgGetSetting("title_sep"); |
460 | 463 |
461 $galMode = mgGetRequestItem("mode", "view", TRUE); | 464 $galMode = mgGetRequestItem("mode", "view", TRUE); |
462 $galPath = mgGetRequestItem("path", ".", TRUE); | 465 $galPath = mgGetRequestItem("path", ".", TRUE); |
569 // pageImageBox | 572 // pageImageBox |
570 "<div id=\"pageImageBox\">\n". | 573 "<div id=\"pageImageBox\">\n". |
571 mgGetNaviControlImageBoxJS($galImagesIndex, $index, "prevBtm", -1)."\n". | 574 mgGetNaviControlImageBoxJS($galImagesIndex, $index, "prevBtm", -1)."\n". |
572 mgGetNaviControlImageBox($galImagesIndex, $index, "prev", -1)."\n". | 575 mgGetNaviControlImageBox($galImagesIndex, $index, "prev", -1)."\n". |
573 "<div id=\"imageImageBox\" class=\"imageBox\">". | 576 "<div id=\"imageImageBox\" class=\"imageBox\">". |
574 "<img id=\"imageImage\" src=\"".mgGetImageURL($galMedPath, $galImage). | 577 "<img id=\"imageImage\" src=\"".mgGetImageURL($galMedPath, $galImage, $galMedFormat). |
575 "\" alt=\"".chentities($galImage)."\">". | 578 "\" alt=\"".chentities($galImage)."\">". |
576 "</div>\n". | 579 "</div>\n". |
577 mgGetNaviControlImageBoxJS($galImagesIndex, $index, "nextBtm", 1)."\n". | 580 mgGetNaviControlImageBoxJS($galImagesIndex, $index, "nextBtm", 1)."\n". |
578 mgGetNaviControlImageBox($galImagesIndex, $index, "next", 1)."\n". | 581 mgGetNaviControlImageBox($galImagesIndex, $index, "next", 1)."\n". |
579 "</div>\n". // pageImageBox | 582 "</div>\n". // pageImageBox |