require 'config.php';
+// load plugins
+$plugins = scandir("plugins");
+array_shift($plugins); array_shift($plugins); // remove . and ..
+foreach ($plugins as $p) if (is_file("plugins/$p/functions.php"))
+ require "plugins/$p/functions.php";
+
+if (! function_exists('getThumbTarget')) {
+function getThumbTarget($imageSimplePath)
+{
+ return dirname($_SERVER["SCRIPT_NAME"]).'/'.IMAGES_DIR.$imageSimplePath;
+}
+}
+
function getPreview($imgFile, $maxSize = THUMB_SIZE)
{
# example: data/myalbum/100.mypic.jpg
$ext = strtolower(substr($file, -4));
if ($ext == ".jpg" or $ext == ".png") {
$link = dirname($scriptUrlPath)."/$realDir/$file";
+ $link = getThumbTarget("$shortPath/$file");
$imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file"), "link" => $link );
left: 0;
}
</style>
+<?php foreach ($plugins as $p) if (is_file("plugins/$p/style.css")) { ?>
+ <link rel="stylesheet" type="text/css" href="<?php echo dirname($scriptUrlPath)."/plugins/$p/style.css" ?>" />
+<?php } ?>
</head>
<body>