From: Mischa POSLAWSKY Date: Fri, 15 Jan 2021 10:25:14 +0000 (+0100) Subject: foto: inline showthumb function to format img elements X-Git-Tag: v5.2~12 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/34e9faadbfc3d908abcb43d10b3a6eb2c4798efd foto: inline showthumb function to format img elements Slight code simplification. --- diff --git a/foto/index.php b/foto/index.php index 49e5483..e7f1bab 100644 --- a/foto/index.php +++ b/foto/index.php @@ -48,26 +48,6 @@ if (isset($Page->raw)) { print $Page->raw; # page intro } -if (!function_exists('showthumb')) { -function showthumb($path) -{ - // assume all album entries are symlinks to archive originals - $target = preg_replace('{^(\.\./)*}', '', readlink($path)); - $thumb = 'thumb/262/' . $target; - - @list ($order, $size, $title) = explode(':', pathinfo($path, PATHINFO_FILENAME), 3); - $imgtag = 'img src="/'.$thumb.'"'; - if ($title) { - $imgtag .= ' title="'.htmlspecialchars(urldecode($title)).'"'; - } - if ($size) { - $imgtag .= ' data-size="'.$size.'"'; - } - - return sprintf('<%s />'."\n", $target, $imgtag); -} -} - if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) { natsort($imgs); print '