Some typo simplification for the getThumbTarget call
[bizou.git] / index.php
index b464e04..8a69018 100644 (file)
--- a/index.php
+++ b/index.php
@@ -25,6 +25,12 @@ array_shift($plugins); array_shift($plugins); // remove . and ..
 foreach ($plugins as $p) if (is_file("plugins/$p/functions.php"))
        require "plugins/$p/functions.php";
 
+function plugins_include($phpFile)
+{
+       foreach ($GLOBALS['plugins'] as $p) if (is_file("plugins/$p/$phpFile"))
+               require "plugins/$p/$phpFile";
+}
+
 if (! function_exists('getThumbTarget')) {
 function getThumbTarget($imageSimplePath)
 {
@@ -132,11 +138,7 @@ foreach (scandir($realDir) as $file) if ($file != '.' and $file != '..')
        {
                $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 );
-
+                       $imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file"), "link" => getThumbTarget("$shortPath/$file") );
                } else {
                        $otherFiles[] = array( "name" => $file, "link" => dirname($scriptUrlPath)."/$realDir/$file" );
                }
@@ -189,6 +191,9 @@ a {
        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>
 
@@ -196,6 +201,8 @@ a {
        <div id="parentfolder"><a href="<?php echo $parentLink ?>">^</a></div>
 <?php } ?>
 
+<?php plugins_include("before_content.php") ?>
+
 <?php foreach($folders as $folder) { ?>
        <div class="folder">
        <?php if ($folder["preview"] === "") { ?>