Archived
1
0
Fork 0

update javascript libraries (fixes #47)

* jQuery 1.3.2
 * jQuery colorBlend 1.6.1
 * balupton's jQuery_lightbox_bal 1.3.7

configurability improvements (addresses #49)

 * includes/galleryfunctions.php:
  - make gallery configurable
  - fix a PHP warning
 * gallery.ini
  - initial gallery configuration
 * index.php
  - render valid XHTML 1.0 strict markup (fixes #48)
This commit is contained in:
Jan Dittberner 2009-07-10 20:55:45 +00:00
parent 51a78c1d3d
commit 7a00edd2f5
11 changed files with 6884 additions and 312 deletions

View file

@ -34,15 +34,26 @@ define(IMAGESEC, "images");
define(GALLERYSEC, "gallery");
define(GALLERY_RE, '/^[\w\d _-]+$/');
if (!realpath('gallery.ini')) {
die('gallery.ini not found in ' . getcwd());
}
$configuration = parse_ini_file(realpath('gallery.ini'));
if (array_key_exists('logfile', $configuration)) {
error_reporting(E_ALL);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log', $configuration['logfile']);
}
/**
* Breite der Vorschaubilder.
*/
$previewwidth = 311;
$previewwidth = $configuration['previewwidth'];
/**
* Höhe der Thumbnailbilder.
*/
$thumbheight = 67;
$thumbheight = $configuration['thumbheight'];
/**
* Prüft, ob eine Galerie mit dem übergebenen Namen existiert.
@ -169,7 +180,8 @@ function getGalleryLabel($galleryname) {
* @return Galeriename
*/
function getCurrentGallery() {
if (galleryExists($_GET["galleryname"])) {
if (array_key_exists('galleryname', $_GET) &&
galleryExists($_GET["galleryname"])) {
return $_GET["galleryname"];
}
$filepath = realpath(GALLERYPREFIX . DIRECTORY_SEPARATOR . INFOFILE);
@ -223,6 +235,8 @@ function getScaledImage($galleryname, $basename, $maxdim, $scaleheight=true) {
// versuchen das Thumbnail-Verzeichnis anzulegen
$mkdir = @mkdir($scaleddirpath, 0755);
if (!$mkdir) {
trigger_error("could not create directory $scaleddirpath.\n",
E_USER_WARNING);
return $galleryname . DIRECTORY_SEPARATOR . $basename;
}
}