diff --git a/includes/galleryfunctions.php b/includes/galleryfunctions.php index 69baf0e..ce313e1 100644 --- a/includes/galleryfunctions.php +++ b/includes/galleryfunctions.php @@ -377,7 +377,7 @@ function getAllThumbnails(&$thumbinfo) { $retval = array(); foreach ($thumbinfo[2] as $basename => $data) { - $retval[] = array('src' => $configuration['gallerydir'] . DIRECTORY_SEPARATOR . $data[0], + $retval[] = array('src' => $configuration['gallerypath'] . DIRECTORY_SEPARATOR . $data[0], 'sizes' => $data[1][3], 'alt' => getImageLabel($thumbinfo[1], $basename)); } diff --git a/includes/theme.class.php b/includes/theme.class.php index 33a0de7..dd327be 100644 --- a/includes/theme.class.php +++ b/includes/theme.class.php @@ -28,7 +28,8 @@ * . */ -require('includes/template.class.php'); +$dir = dirname(realpath(__file__)); +require("$dir" . DIRECTORY_SEPARATOR . "template.class.php"); /** * Theme class. @@ -66,7 +67,7 @@ class Theme { */ function __construct($name, &$configuration) { $themeini = realpath(implode(DIRECTORY_SEPARATOR, - array('themes', $name, 'theme.ini'))); + array($configuration['themedir'], $name, 'theme.ini'))); if (!$themeini) { die("invalid theme $name"); } diff --git a/index.php b/index.php index bc0c3eb..57a7d22 100644 --- a/index.php +++ b/index.php @@ -32,7 +32,7 @@ * . */ -$basedir = dirname(__file__); +$basedir = realpath(dirname(__file__)); /** * Inkludiert die Funktionsbibliothek. @@ -59,16 +59,17 @@ $template = $theme->getTemplate(); if ($theme->themetype == 'horizontal') { $inlinestyles = sprintf("#scrollable { width:%dpx; }\n", $thumbinfo[0]); - $inlinescript = "var themetype='horizontal';"; + $inlinescript = array("var themetype='horizontal';"); } else { $inlinestyles = sprintf("#scrollable { height:%dpx; }\n", $thumbinfo[0]); - $inlinescript = "var themetype='vertical';"; + $inlinescript = array("var themetype='vertical';"); } +$inlinescript[] = "var basepath='" . $configuration['basepath'] . "';"; $template->assign('scripts', $scripts); $template->assign('styles', $styles); $template->assign('inlinestyle', $inlinestyles); -$template->assign('inlinescript', $inlinescript); +$template->assign('inlinescript', implode("\n", $inlinescript)); $template->assign('title', getGalleryTitle($thumbinfo)); $template->assign('gallerylinks', getGalleryLinks()); $template->assign('thumbnails', getAllThumbnails($thumbinfo)); diff --git a/scripts/ourhandlers.js b/scripts/ourhandlers.js index f3f00f1..cbc945d 100644 --- a/scripts/ourhandlers.js +++ b/scripts/ourhandlers.js @@ -51,7 +51,7 @@ function getPathParts(imagesrc) { } function updateContentImage(pathParts) { - $.getJSON("ajaxrequest.php", { + $.get(basepath + "ajaxrequest.php", { "imagename" : pathParts.filename, "galleryname" : pathParts.gallery }, function(data, textStatus) { @@ -61,7 +61,7 @@ function updateContentImage(pathParts) { $("#content_main a").attr("href", data["full"]); $("#content_main a").attr("title", data["label"]); document.title = data["title"]; - }); + }, 'json'); } $(document).ready(function() {