projects
/
bizou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d7db66c
)
Added config constant to use view.php or not
author
Marc MAURICE
<dooblempub@positon.org>
Sun, 24 Oct 2010 22:06:54 +0000
(
00:06
+0200)
committer
Marc MAURICE
<dooblempub@positon.org>
Sun, 24 Oct 2010 22:06:54 +0000
(
00:06
+0200)
index.php
patch
|
blob
|
history
diff --git
a/index.php
b/index.php
index
09ba285
..
195ca3b
100644
(file)
--- a/
index.php
+++ b/
index.php
@@
-3,6
+3,7
@@
define('THUMB_SIZE', 100);
define('DATA_DIR', 'data');
define('IMAGES_DIR', 'images');
define('THUMB_SIZE', 100);
define('DATA_DIR', 'data');
define('IMAGES_DIR', 'images');
+define('USE_VIEWER', true);
function getPreview($imgFile, $maxSize = THUMB_SIZE)
{
function getPreview($imgFile, $maxSize = THUMB_SIZE)
{
@@
-94,10
+95,17
@@
foreach (scandir($realDir) as $file) if ($file != '.' and $file != '..')
else
{
$ext = strtolower(substr($file, -4));
else
{
$ext = strtolower(substr($file, -4));
- if ($ext == ".jpg" or $ext == ".png")
- $imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file"), "link" => dirname($scriptUrlPath)."/view.php$shortPath/$file" );
- else
+ if ($ext == ".jpg" or $ext == ".png") {
+ if (USE_VIEWER)
+ $link = dirname($scriptUrlPath)."/view.php$shortPath/$file";
+ else
+ $link = dirname($scriptUrlPath)."/$realDir/$file";
+
+ $imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file"), "link" => $link );
+
+ } else {
$otherFiles[] = array( "name" => $file, "link" => dirname($scriptUrlPath)."/$realDir/$file" );
$otherFiles[] = array( "name" => $file, "link" => dirname($scriptUrlPath)."/$realDir/$file" );
+ }
}
}
}
}