From 0f8dda1b1bc68888eab4a787573d87c25c08d941 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 27 Aug 2008 22:04:20 +0000 Subject: [PATCH] =?UTF-8?q?Erstes=20gro=C3=9Fes=20Refactoring=20=20*=20all?= =?UTF-8?q?e=20gemeinsamen=20Funktionen=20in=20includes/galleryfunctions.p?= =?UTF-8?q?hp=20=20=20=20zusammengef=C3=BChrt=20(fixes=20#21)=20=20*=20AJA?= =?UTF-8?q?X-Requests=20werden=20in=20ajaxrequest.php=20behandelt=20und=20?= =?UTF-8?q?liefern=20=20=20=20zus=C3=A4tzlich=20zum=20Titel=20auch=20die?= =?UTF-8?q?=20URLs=20des=20Vorschau-=20und=20des=20Vollbildes=20=20=20=20(?= =?UTF-8?q?fixes=20#22),=20die=20=C3=BCbergebenen=20Request-Parameter=20we?= =?UTF-8?q?rden=20syntaktisch=20=20=20=20gepr=C3=BCft=20(fixes=20#23)=20?= =?UTF-8?q?=20*=20Die=20Vorschau-=20und=20Thumbnail-Bilder=20werden=20in?= =?UTF-8?q?=20der=20Funktion=20=20=20=20getScaledImage()=20in=20includes/g?= =?UTF-8?q?alleryfunctions.php=20generiert=20und=20im=20=20=20=20Filesyste?= =?UTF-8?q?m=20abgelegt=20(fixes=20#10)=20=20*=20Bildbeschreibungen=20sind?= =?UTF-8?q?=20jetzt=20in=20einem=20.ini-Format=20in=20=20=20=20bilder/exam?= =?UTF-8?q?ple/galleryinfo.ini=20in=20der=20Sektion=20"images"=20definiert?= =?UTF-8?q?=20=20=20=20(addresses=20#20)=20=20*=20Rendern=20der=20Men?= =?UTF-8?q?=C3=BCpunkte=20in=20index.php=20und=20=20=20=20includes/gallery?= =?UTF-8?q?functions.php=20vorbereitet=20(addresses=20#16)=20=20*=20Die=20?= =?UTF-8?q?AJAX-Aufrufe=20und=20Pfadberechnungen=20in=20scripts/ourhandler?= =?UTF-8?q?s.js=20=20=20=20wurden=20korrigiert=20und=20an=20die=20neue=20A?= =?UTF-8?q?JAX-Handler-URL=20angepasst=20=20=20=20(addresses=20#22,=20fixe?= =?UTF-8?q?s=20#19)=20=20*=20Beispielbilder=20in=20Unterverzeichnis=20''bi?= =?UTF-8?q?lder/example''=20verschoben=20=20=20=20und=20die=20M=C3=B6glich?= =?UTF-8?q?keit=20vorgesehen=20in=20''bilder/galleryinfo.ini''=20eine=20?= =?UTF-8?q?=20=20=20Standardgallerie=20anzugeben=20(fixes=20#24,=20address?= =?UTF-8?q?es=20#20,=20#16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- funktionen/description.php => ajaxrequest.php | 27 +- bilder/{ => example}/cimg3033_Small.jpg | Bin bilder/{ => example}/cimg3071_Small.jpg | Bin bilder/{ => example}/cimg3157_Small.jpg | Bin bilder/{ => example}/cimg4188_Small.jpg | Bin bilder/{ => example}/cimg4191_Small.jpg | Bin bilder/{ => example}/cimg5178_Small.jpg | Bin bilder/example/galleryinfo.ini | 7 + bilder/imginfo.txt | 6 - fetchdescription.php | 56 ----- funktionen/show_pictures.php | 33 --- funktionen/thumbnail.php | 41 ---- funktionen/thumbnail_show.php | 31 --- includes/galleryfunctions.php | 224 +++++++++++++++++ index.php | 232 +++++++++--------- menu/menu.php | 48 ---- scripts/jquery.lightbox.js | 26 +- scripts/ourhandlers.js | 105 ++++---- submenu.php | 27 -- 19 files changed, 435 insertions(+), 428 deletions(-) rename funktionen/description.php => ajaxrequest.php (59%) rename bilder/{ => example}/cimg3033_Small.jpg (100%) rename bilder/{ => example}/cimg3071_Small.jpg (100%) rename bilder/{ => example}/cimg3157_Small.jpg (100%) rename bilder/{ => example}/cimg4188_Small.jpg (100%) rename bilder/{ => example}/cimg4191_Small.jpg (100%) rename bilder/{ => example}/cimg5178_Small.jpg (100%) create mode 100644 bilder/example/galleryinfo.ini delete mode 100644 bilder/imginfo.txt delete mode 100644 fetchdescription.php delete mode 100644 funktionen/show_pictures.php delete mode 100644 funktionen/thumbnail.php delete mode 100644 funktionen/thumbnail_show.php create mode 100644 includes/galleryfunctions.php delete mode 100644 menu/menu.php delete mode 100644 submenu.php diff --git a/funktionen/description.php b/ajaxrequest.php similarity index 59% rename from funktionen/description.php rename to ajaxrequest.php index 814af54..e3a24a9 100644 --- a/funktionen/description.php +++ b/ajaxrequest.php @@ -1,13 +1,11 @@ - * Jan Dittberner IT-Consulting & -Solutions + * Jan Dittberner IT-Consulting & -Solutions, * Cottbuser Str. 1, D-01129 Dresden * - * Copyright (c) 2008 Jeremias Arnstadt - * * This file is part of the ScrollingJQueryGallery component of the * gnuviech-server.de Websitetools * @@ -27,10 +25,19 @@ * * Version: $Id$ */ -include_once("fetchdescription.php"); -$imginfo = getImgInfo($allfiles[0]); -if (is_array($imginfo) && isset($imginfo["data"])) { - print htmlentities($imginfo["data"]); +include("includes/galleryfunctions.php"); + +if (isset($_GET["imagename"]) && isset($_GET["galleryname"]) && + preg_match('/^[\w\d _-]+\.jp(e|)g$/', $_GET["imagename"]) && + preg_match(GALLERY_RE, $_GET["galleryname"])) { + header("Content-Type: text/plain; charset=UTF-8"); + if ($imageInfo = getImgInfo($_GET["galleryname"], $_GET["imagename"])) { + print json_encode($imageInfo); + } else { + header("HTTP/1.0 404 Not Found"); + header("Status: 404 Not Found"); + } } else { - print $imginfo; + header("HTTP/1.0 400 Bad Request"); + header("Status: 400 Bad Request"); } diff --git a/bilder/cimg3033_Small.jpg b/bilder/example/cimg3033_Small.jpg similarity index 100% rename from bilder/cimg3033_Small.jpg rename to bilder/example/cimg3033_Small.jpg diff --git a/bilder/cimg3071_Small.jpg b/bilder/example/cimg3071_Small.jpg similarity index 100% rename from bilder/cimg3071_Small.jpg rename to bilder/example/cimg3071_Small.jpg diff --git a/bilder/cimg3157_Small.jpg b/bilder/example/cimg3157_Small.jpg similarity index 100% rename from bilder/cimg3157_Small.jpg rename to bilder/example/cimg3157_Small.jpg diff --git a/bilder/cimg4188_Small.jpg b/bilder/example/cimg4188_Small.jpg similarity index 100% rename from bilder/cimg4188_Small.jpg rename to bilder/example/cimg4188_Small.jpg diff --git a/bilder/cimg4191_Small.jpg b/bilder/example/cimg4191_Small.jpg similarity index 100% rename from bilder/cimg4191_Small.jpg rename to bilder/example/cimg4191_Small.jpg diff --git a/bilder/cimg5178_Small.jpg b/bilder/example/cimg5178_Small.jpg similarity index 100% rename from bilder/cimg5178_Small.jpg rename to bilder/example/cimg5178_Small.jpg diff --git a/bilder/example/galleryinfo.ini b/bilder/example/galleryinfo.ini new file mode 100644 index 0000000..1216d4b --- /dev/null +++ b/bilder/example/galleryinfo.ini @@ -0,0 +1,7 @@ +[images] +cimg3033_Small.jpg = Kerze +cimg3071_Small.jpg = Gerät +cimg3157_Small.jpg = Abstract +cimg4188_Small.jpg = Blume +cimg4191_Small.jpg = Blume - Rose +cimg5178_Small.jpg = Gerät nah diff --git a/bilder/imginfo.txt b/bilder/imginfo.txt deleted file mode 100644 index 6ab3257..0000000 --- a/bilder/imginfo.txt +++ /dev/null @@ -1,6 +0,0 @@ -cimg3033_Small.jpg Kerze -cimg3071_Small.jpg Gerät -cimg3157_Small.jpg Abstract -cimg4188_Small.jpg Blume -cimg4191_Small.jpg Blume - Rose -cimg5178_Small.jpg Gerät nah \ No newline at end of file diff --git a/fetchdescription.php b/fetchdescription.php deleted file mode 100644 index 6b0322b..0000000 --- a/fetchdescription.php +++ /dev/null @@ -1,56 +0,0 @@ - - * Jan Dittberner IT-Consulting & -Solutions, - * Cottbuser Str. 1, D-01129 Dresden - * - * This file is part of the ScrollingJQueryGallery component of the - * gnuviech-server.de Websitetools - * - * ScrollingJQueryGallery is free software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * ScrollingJQueryGallery is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ScrollingJQueryGallery. If not, see - * . - * - * Version: $Id$ - */ -$infofile = "bilder/imginfo.txt"; -$prefix = "bilder/"; - -function getImgInfo($imagename) { - if (file_exists($imagename)) { - $imagename = substr($imagename, strlen($GLOBALS["prefix"])); - } - if (file_exists($GLOBALS["prefix"] . $imagename)) { - foreach (file($GLOBALS["infofile"]) as $line) { - $firstspace = strpos($line, " "); - $name = substr($line, 0, $firstspace); - $data = trim(substr($line, $firstspace + 1)); - if (strcmp($name, $imagename) == 0) { - $retval = array("name" => $name, - "data" => trim($data)); - break; - } - } - } else { - return $GLOBALS["prefix"] . $imagename . " doesn't exist"; - } - return $retval; -} - -if (isset($_GET["imagename"])) { - header("Content-Type: text/plain; charset=UTF-8"); - print json_encode(getImgInfo($_GET["imagename"])); -} diff --git a/funktionen/show_pictures.php b/funktionen/show_pictures.php deleted file mode 100644 index 87501bc..0000000 --- a/funktionen/show_pictures.php +++ /dev/null @@ -1,33 +0,0 @@ - - * Jan Dittberner IT-Consulting & -Solutions - * Cottbuser Str. 1, D-01129 Dresden - * - * Copyright (c) 2008 Jeremias Arnstadt - * - * This file is part of the ScrollingJQueryGallery component of the - * gnuviech-server.de Websitetools - * - * ScrollingJQueryGallery is free software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * ScrollingJQueryGallery is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ScrollingJQueryGallery. If not, see - * . - * - * Version: $Id$ - */ -$width_middle = 311; -printf("\"\"", - dirname($allfiles[0]) . DIRECTORY_SEPARATOR . basename($allfiles[0]), - $allfiles[0], $width_middle); diff --git a/funktionen/thumbnail.php b/funktionen/thumbnail.php deleted file mode 100644 index 304305f..0000000 --- a/funktionen/thumbnail.php +++ /dev/null @@ -1,41 +0,0 @@ - -* Jan Dittberner IT-Consulting & -Solutions -* Cottbuser Str. 1, D-01129 Dresden -* -* This file is part of the ScrollingJQueryGallery component of the -* gnuviech-server.de Websitetools -* -* ScrollingJQueryGallery is free software: you can redistribute it -* and/or modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* ScrollingJQueryGallery is distributed in the hope that it will be -* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with ScrollingJQueryGallery. If not, see -* . -* -* Version: $Id$ -*/ - -$thumbsizes = array(); -$thumbwidthsum = 2; -$thumbheight = 67; -foreach ($allfiles as $filename) { - $directory = dirname($filename); - $basename = basename($filename); - $thumbfile = $directory . - DIRECTORY_SEPARATOR . $basename; - if ($thumbsize = getimagesize($thumbfile)) { - $thumbsizes[$thumbfile] = $thumbsize; - $thumbwidthsum = $thumbwidthsum + $thumbsize[0] + 3; - } -} diff --git a/funktionen/thumbnail_show.php b/funktionen/thumbnail_show.php deleted file mode 100644 index 4f71acd..0000000 --- a/funktionen/thumbnail_show.php +++ /dev/null @@ -1,31 +0,0 @@ - - * Jan Dittberner IT-Consulting & -Solutions - * Cottbuser Str. 1, D-01129 Dresden - * - * This file is part of the ScrollingJQueryGallery component of the - * gnuviech-server.de Websitetools - * - * ScrollingJQueryGallery is free software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * ScrollingJQueryGallery is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ScrollingJQueryGallery. If not, see - * . - * - * Version: $Id$ - */ -foreach ($thumbsizes as $thumbfile => $thumbsize) { - printf("
\"\"
", - $thumbfile, $thumbheight); -} diff --git a/includes/galleryfunctions.php b/includes/galleryfunctions.php new file mode 100644 index 0000000..ab165c8 --- /dev/null +++ b/includes/galleryfunctions.php @@ -0,0 +1,224 @@ + + * Jan Dittberner IT-Consulting & -Solutions, + * Cottbuser Str. 1, D-01129 Dresden + * + * This file is part of the ScrollingJQueryGallery component of the + * gnuviech-server.de Websitetools + * + * ScrollingJQueryGallery is free software: you can redistribute it + * and/or modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * ScrollingJQueryGallery is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ScrollingJQueryGallery. If not, see + * . + * + * Version: $Id$ + */ + +define(GALLERYPREFIX, "bilder"); +define(INFOFILE, "galleryinfo.ini"); +define(IMAGESEC, "images"); +define(GALLERYSEC, "gallery"); +define(GALLERY_RE, '/^[\w\d _-]+$/'); + +$previewwidth = 311; +$thumbheight = 67; + +function galleryExists($galleryname) { + return preg_match(GALLERY_RE, $galleryname) && + realpath(GALLERYPREFIX . DIRECTORY_SEPARATOR . $galleryname); +} + +function getGalleryConfig($galleryname = null) { + if ($galleryname) { + $filepath = realpath(GALLERYPREFIX . DIRECTORY_SEPARATOR . + $galleryname . DIRECTORY_SEPARATOR . INFOFILE); + } else { + $filepath = realpath(GALLERYPREFIX . DIRECTORY_SEPARATOR . INFOFILE); + } + if (is_file($filepath)) { + return parse_ini_file($filepath, true); + } + return array(); +} + +/** + * Holt die Bildinformationen zu einem Bild aus der Datei + * bilder/imginfo.txt und gibt diese zurueck. + * + * @param $imagename Bildname + * @param $galleryname Galleriename + */ +function getImgInfo($galleryname, $imagename) { + return array("name" => $imagename, + "data" => getImageLabel($galleryname, $imagename), + "preview" => GALLERYPREFIX . DIRECTORY_SEPARATOR . + getScaledImage($galleryname, $imagename, + $GLOBALS["previewwidth"], false), + "full" => GALLERYPREFIX . DIRECTORY_SEPARATOR . $galleryname . + DIRECTORY_SEPARATOR . $imagename + ); +} + +function getImageLabel($galleryname, $imagename) { + $gallerypath = realpath(GALLERYPREFIX . DIRECTORY_SEPARATOR . $galleryname); + if (empty($gallerypath) || !is_dir($gallerypath)) { + return false; + } + $filepath = $gallerypath . DIRECTORY_SEPARATOR . $imagename; + if (!is_file($filepath)) { + return false; + } + $inidata = getGalleryConfig($galleryname); + $value = $inidata[IMAGESEC][$imagename]; + if ($value) { + return $value; + } + return $imagename; +} + +/** + * Liefert die aktuelle Gallerie. Die Gallerie kann entweder im + * GET-Parameter "galleryname" stehen, in der "gallery"-Sektion der + * zentralen galleryinfo.ini angegeben werden oder es wird das erste + * Unterverzeichnis von GALLERYPREFIX verwendet. + */ +function getCurrentGallery() { + if (galleryExists($_GET["galleryname"])) { + return $_GET["galleryname"]; + } + $filepath = realpath(GALLERYPREFIX . DIRECTORY_SEPARATOR . INFOFILE); + if (!empty($filepath)) { + $inidata = getGalleryConfig(); + if (galleryExists($inidata[GALLERYSEC]["default"])) { + return $inidata[GALLERYSEC]["default"]; + } + } + foreach (glob(realpath(GALLERYPREFIX) . DIRECTORY_SEPARATOR . '*', + GLOB_ONLYDIR) as $directory) { + $basename = basename($directory); + if (galleryExists($basename)) { + return $basename; + } + } + return null; +} + +function getScaledImage($galleryname, $basename, $maxdim, $scaleheight=true) { + if ($maxdim == 0) { + debug_print_backtrace(); + } + $gallerydir = realpath(GALLERYPREFIX . DIRECTORY_SEPARATOR . $galleryname); + if ($scaleheight) { + $scaleddir = sprintf("%s%sscaled_x%d", $galleryname, + DIRECTORY_SEPARATOR, $maxdim); + } else { + $scaleddir = sprintf("%s%sscaled%dx_", $galleryname, + DIRECTORY_SEPARATOR, $maxdim); + } + $scaleddirpath = GALLERYPREFIX . DIRECTORY_SEPARATOR . $scaleddir; + if (!is_dir($scaleddirpath)) { + // versuchen das Thumbnail-Verzeichnis anzulegen + $mkdir = @mkdir($scaleddirpath, 0755); + if (!$mkdir) { + return $galleryname . DIRECTORY_SEPARATOR . $basename; + } + } + + $scaledimage = $scaleddirpath . DIRECTORY_SEPARATOR . $basename; + if (!is_file($scaledimage)) { + // Datei erzeugen + $originalfile = $gallerydir . DIRECTORY_SEPARATOR . $basename; + $origimage = imagecreatefromjpeg($originalfile); + $origx = imagesx($origimage); + $origy = imagesy($origimage); + if ($scaleheight) { + $scaleratio = $origy / (1.0 * $maxdim); + $newy = $maxdim; + $newx = (int) $origx / $scaleratio; + } else { + $scaleratio = $origx / (1.0 * $maxdim); + $newx = $maxdim; + $newy = (int) $origy / $scaleratio; + } + $newimage = imagecreatetruecolor($newx, $newy); + imagecopyresampled($newimage, $origimage, 0, 0, 0, 0, $newx, $newy, + $origx, $origy); + imagejpeg($newimage, $scaledimage, 90); + } + return $scaleddir . DIRECTORY_SEPARATOR . $basename; +} + +/** + * Gibt die Informationen über Vorschaubilder zurück. + * + * @return array das erste Element ist die aufsummierte Breite der + * Einzelbilder und das zweite Element ist ein assoziatives Array mit + * den Bildnamen als Keys und dem Ergebnis von getimagesize() als + * Werten + */ +function getThumbNailInfo($galleryname) { + $thumbsizes = array(); + $thumbwidthsum = 2; + foreach (glob(realpath(GALLERYPREFIX . DIRECTORY_SEPARATOR . + $galleryname) . DIRECTORY_SEPARATOR . + '*.jp{e,}g', GLOB_BRACE) as $filename) { + $basename = basename($filename); + $thumbfile = getScaledImage($galleryname, $basename, + $GLOBALS["thumbheight"]); + if ($thumbsize = getimagesize(realpath(GALLERYPREFIX . + DIRECTORY_SEPARATOR . + $thumbfile))) { + $thumbsizes[$basename] = array($thumbfile, $thumbsize); + $thumbwidthsum = $thumbwidthsum + $thumbsize[0] + 3; + } + } + return array($thumbwidthsum, $galleryname, $thumbsizes); +} + +function getGalleryLinks() { +} + +function showThumbnails(&$thumbinfo) { + foreach ($thumbinfo[2] as $basename => $data) { + printf("
\"\"
", + GALLERYPREFIX . DIRECTORY_SEPARATOR . $data[0], + $data[1][3]);; + } +} + +function showPreview(&$thumbinfo) { + foreach ($thumbinfo[2] as $basename => $data) { + $galleryname = $thumbinfo[1]; + $fullname = GALLERYPREFIX . DIRECTORY_SEPARATOR . $galleryname . + DIRECTORY_SEPARATOR . $basename; + $scaledimage = getScaledImage($galleryname, $basename, + $GLOBALS["previewwidth"], false); + $scaledimagesize = getimagesize(realpath(GALLERYPREFIX . + DIRECTORY_SEPARATOR . + $scaledimage)); + printf("\"%s\"", + $fullname, GALLERYPREFIX, DIRECTORY_SEPARATOR, $scaledimage, + getImageLabel($galleryname, $basename), $scaledimagesize[3]); + break; + } +} + +function renderDescription(&$thumbinfo) { + foreach ($thumbinfo[2] as $basename => $data) { + print htmlentities(getImageLabel($thumbinfo[1], $basename)); + break; + } +} diff --git a/index.php b/index.php index 65963c0..8145fa4 100644 --- a/index.php +++ b/index.php @@ -1,118 +1,116 @@ - - * Jan Dittberner IT-Consulting & -Solutions - * Cottbuser Str. 1, D-01129 Dresden - * - * Copyright (c) 2008 Jeremias Arnstadt - * - * This file is part of the ScrollingJQueryGallery component of the - * gnuviech-server.de Websitetools - * - * ScrollingJQueryGallery is free software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * ScrollingJQueryGallery is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ScrollingJQueryGallery. If not, see - * . - * - * Version: $Id$ - */ -// Pfad der Bilder für die jeweilige Kategorie -$allfiles = glob("./bilder/*.jpg"); -// Name des Menüpunktes -$menupunkt = "Beispielbilder 1"; - -// greift auf die Funktionen der ausgelagerten Datei um die Thumbnails -// einzulesen -include ("./funktionen/thumbnail.php"); - -// bezieht sich auf die Hauptmenükategorie (für Anzeige von aktivem -// Link notwendig) -$kategorie = ($bilder_kat = 1); - -// bezieht sich auf die Submenükategorie (für Anzeige von aktivem Link -// notwendig) -$nav_auswahl = ($bilder_kat_sub = 1); - -// bezieht sich auf das Auswahlmenü -$aquarelle = ($menu = 14); -?> - - - -Bilderframework - - - - - - - - - - - -
-
- -
-
-
nach links
-
-
nach rechts
-
- -
-
-
-
-
-
- backnext -
-
-
-
-
- - + + * Jan Dittberner IT-Consulting & -Solutions + * Cottbuser Str. 1, D-01129 Dresden + * + * Copyright (c) 2008 Jeremias Arnstadt + * + * This file is part of the ScrollingJQueryGallery component of the + * gnuviech-server.de Websitetools + * + * ScrollingJQueryGallery is free software: you can redistribute it + * and/or modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * ScrollingJQueryGallery is distributed in the hope that it will be + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with ScrollingJQueryGallery. If not, see + * . + * + * Version: $Id$ + */ + +// Name des Menüpunktes +$menupunkt = "Beispielbilder 1"; + +// greift auf die Funktionen der ausgelagerten Datei um die Thumbnails +// einzulesen +include ("includes/galleryfunctions.php"); + +$gallery = getCurrentGallery(); +$thumbinfo = getThumbNailInfo($gallery); + +// bezieht sich auf die Hauptmenükategorie (für Anzeige von aktivem +// Link notwendig) +$kategorie = ($bilder_kat = 1); + +// bezieht sich auf die Submenükategorie (für Anzeige von aktivem Link +// notwendig) +$nav_auswahl = ($bilder_kat_sub = 1); + +// bezieht sich auf das Auswahlmenü +$aquarelle = ($menu = 14); +?> + + + +Bilderframework + + + + + + + + + + + +
+
+ +
+
+
nach links
+
+
nach rechts
+
+
+
+
+
+
+
+ backnext +
+
+
+
+
+ + \ No newline at end of file diff --git a/menu/menu.php b/menu/menu.php deleted file mode 100644 index dc4d49e..0000000 --- a/menu/menu.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Jan Dittberner IT-Consulting & -Solutions - * Cottbuser Str. 1, D-01129 Dresden - * - * Copyright (c) 2008 Jeremias Arnstadt - * - * This file is part of the ScrollingJQueryGallery component of the - * gnuviech-server.de Websitetools - * - * ScrollingJQueryGallery is free software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * ScrollingJQueryGallery is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ScrollingJQueryGallery. If not, see - * . - * - * Version: $Id$ - */ -/* -$verzeichnis = realpath($_SERVER['DOCUMENT_ROOT'] . "/bild_framework/"); -echo "
    "; - -if ( is_dir ($verzeichnis )) -{ -if ( $handle = opendir ($verzeichnis)) - { while (($file = readdir($handle)) !== false) - { - echo "
  1. Dateiname:"; - echo $file; - - echo "
    • Dateityp: "; - echo filetype ( $file ); - echo "
    \n"; - } - closedor($handle); - } - } - echo "
"; -*/ diff --git a/scripts/jquery.lightbox.js b/scripts/jquery.lightbox.js index f4b5246..8201744 100644 --- a/scripts/jquery.lightbox.js +++ b/scripts/jquery.lightbox.js @@ -1,14 +1,14 @@ -/** - * jQuery lightBox plugin - * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) - * and adapted to me for use like a plugin from jQuery. - * @name jquery-lightbox-0.4.pack.js - * @author Leandro Vieira Pinho - http://leandrovieira.com - * @version 0.4 - * @date November 17, 2007 - * @category jQuery plugin - * @copyright (c) 2007 Leandro Vieira Pinho (leandrovieira.com) - * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US - * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin - */ +/** + * jQuery lightBox plugin + * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) + * and adapted to me for use like a plugin from jQuery. + * @name jquery-lightbox-0.4.pack.js + * @author Leandro Vieira Pinho - http://leandrovieira.com + * @version 0.4 + * @date November 17, 2007 + * @category jQuery plugin + * @copyright (c) 2007 Leandro Vieira Pinho (leandrovieira.com) + * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US + * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin + */ eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.2L.3f=6(4){4=1W.2F({2x:\'#32\',2e:0.8,1O:\'V/5-3e-T.Z\',2i:\'V/5-1t-2S.Z\',23:\'V/5-1t-2O.Z\',1V:\'V/5-1t-2I.Z\',19:\'V/5-2G.Z\',17:10,1I:2B,2z:\'1f\',2p:\'33\',2m:\'c\',2h:\'p\',2c:\'n\',h:[],9:0},4);f E=C;6 20(){1Z(C,E);D 1g}6 1Z(1a,E){$(\'1R, 1Q, 1N\').k({\'1M\':\'2D\'});1K();4.h.y=0;4.9=0;7(E.y==1){4.h.1F(u 1h(1a.16(\'H\'),1a.16(\'2v\')))}m{36(f i=0;i<1s g="5-d"><1s P="\'+4.1O+\'"><1c g="5-d-F-1p"><1c g="5-d-F-1o"><1s P="\'+4.1V+\'">\');f w=1m();$(\'#r-N\').k({2J:4.2x,2H:4.2e,Q:w[0],I:w[1]}).1S();f L=1l();$(\'#r-5\').k({1P:L[1]+(w[3]/10),1k:L[0]}).B();$(\'#r-N,#r-5\').K(6(){18()});$(\'#5-T-25,#5-1B-1Y\').K(6(){18();D 1g});$(A).2E(6(){f w=1m();$(\'#r-N\').k({Q:w[0],I:w[1]});f L=1l();$(\'#r-5\').k({1P:L[1]+(w[3]/10),1k:L[0]})})}6 J(){$(\'#5-T\').B();$(\'#5-d,#5-j,#5-j-13,#5-j-X,#5-t-d-Y-v,#5-d-F-1o\').1j();f M=u 1f();M.1L=6(){$(\'#5-d\').2C(\'P\',4.h[4.9][0]);1J(M.Q,M.I);M.1L=6(){}};M.P=4.h[4.9][0]};6 1J(1n,1i){f 1H=$(\'#5-t-d-v\').Q();f 1G=$(\'#5-t-d-v\').I();f 1q=(1n+(4.17*2));f 1r=(1i+(4.17*2));f 1E=1H-1q;f 26=1G-1r;$(\'#5-t-d-v\').3d({Q:1q,I:1r},4.1I,6(){2y()});7((1E==0)&&(26==0)){7($.3c.3b){1C(3a)}m{1C(38)}}$(\'#5-j-13,#5-j-X\').k({I:1i+(4.17*2)});$(\'#5-t-d-Y-v\').k({Q:1n})};6 2y(){$(\'#5-T\').1j();$(\'#5-d\').1S(6(){2u();2s()});2r()};6 2u(){$(\'#5-t-d-Y-v\').35(\'34\');$(\'#5-d-F-1p\').1j();7(4.h[4.9][1]){$(\'#5-d-F-1p\').2o(4.h[4.9][1]).B()}7(4.h.y>1){$(\'#5-d-F-1o\').2o(4.2z+\' \'+(4.9+1)+\' \'+4.2p+\' \'+4.h.y).B()}}6 2s(){$(\'#5-j\').B();$(\'#5-j-13,#5-j-X\').k({\'11\':\'1y U(\'+4.19+\') 12-14\'});7(4.9!=0){$(\'#5-j-13\').1d().2l(6(){$(C).k({\'11\':\'U(\'+4.2i+\') 1k 15% 12-14\'})},6(){$(C).k({\'11\':\'1y U(\'+4.19+\') 12-14\'})}).B().2k(\'K\',6(){4.9=4.9-1;J();D 1g})}7(4.9!=(4.h.y-1)){$(\'#5-j-X\').1d().2l(6(){$(C).k({\'11\':\'U(\'+4.23+\') 30 15% 12-14\'})},6(){$(C).k({\'11\':\'1y U(\'+4.19+\') 12-14\'})}).B().2k(\'K\',6(){4.9=4.9+1;J();D 1g})}2j()}6 2j(){$(b).2Z(6(O){2g(O)})}6 1w(){$(b).1d()}6 2g(O){7(O==2f){S=2Y.2d;1u=27}m{S=O.2d;1u=O.2X}W=2W.2U(S).2T();7((W==4.2m)||(W==\'x\')||(S==1u)){18()}7((W==4.2h)||(S==37)){7(4.9!=0){4.9=4.9-1;J();1w()}}7((W==4.2c)||(S==39)){7(4.9!=(4.h.y-1)){4.9=4.9+1;J();1w()}}}6 2r(){7((4.h.y-1)>4.9){2a=u 1f();2a.P=4.h[4.9+1][0]}7(4.9>0){29=u 1f();29.P=4.h[4.9-1][0]}}6 18(){$(\'#r-5\').28();$(\'#r-N\').2R(6(){$(\'#r-N\').28()});$(\'1R, 1Q, 1N\').k({\'1M\':\'2Q\'})}6 1m(){f q,o;7(A.1b&&A.24){q=A.22+A.2P;o=A.1b+A.24}m 7(b.l.21>b.l.2b){q=b.l.2N;o=b.l.21}m{q=b.l.2M;o=b.l.2b}f z,G;7(R.1b){7(b.s.1e){z=b.s.1e}m{z=R.22}G=R.1b}m 7(b.s&&b.s.1v){z=b.s.1e;G=b.s.1v}m 7(b.l){z=b.l.1e;G=b.l.1v}7(o 0) { + dirname = dirstack.pop(); + } + return { 'filename' : filename, - 'pathstart' : pathstart, 'dirname' : dirname, - 'basename' : basename + 'gallery' : galleryname, + 'pathstart' : pathstart }; - return retval; } function updateContentImage(pathParts) { - var content_main = $("#content_main img").attr("src", - pathParts.pathstart + pathParts.filename); - $("#content_main a").attr("href", pathParts.pathstart + - imgfull + pathParts.filename); - $.getJSON("fetchdescription.php", - {"imagename" : pathParts.basename}, - function(data, textStatus) { - $("#imagedescription").text(data["data"]); - }); + $.getJSON("ajaxrequest.php", { + "imagename" : pathParts.filename, + "galleryname" : pathParts.gallery + }, function(data, textStatus) { + $("#imagedescription").text(data["data"]); + $("#content_main img").attr("alt", data["data"]); + $("#content_main img").attr("src", data["preview"]); + $("#content_main a").attr("href", data["full"]); + }); } $(document).ready(function() { $("#arrleft").mouseover(function() { $("#scrollable").animate({ left: "0px" - }, 5000); + }, 500); }).mouseout(function() { $("#scrollable").stop(); }); @@ -74,35 +75,47 @@ $(document).ready(function() { parseInt($("#scrollable").css("width")); $("#scrollable").animate({ left: offset + "px" - }, 18000); + }, 500); }).mouseout(function() { $("#scrollable").stop(); }); $("#backbtn").click(function() { - var parts = getPathParts($("img#contentimg").attr("src")); - var pred = null; - $("div.thumbnail img").each(function() { - if (pred == null) { - pred = getPathParts(this.src); - } else { - var thumbparts = getPathParts(this.src); - if (thumbparts.basename == parts.basename) { - updateContentImage(pred); + $("div.thumbnail img").each(function(i) { + var curparts = getPathParts($("img#contentimg").attr("src")); + var myparts = getPathParts($(this).attr("src")); + if ((curparts.gallery == myparts.gallery) && + (curparts.filename == myparts.filename)) { + var matched = $("div.thumbnail img"); + var prevparts; + if (i > 0) { + prevparts = getPathParts( + $(matched.get(i-1)).attr("src")); + } else { + prevparts = getPathParts( + $(matched.get(matched.length-1)).attr("src")); } - pred = thumbparts; + updateContentImage(prevparts); + return false; } }); }); $("#fwdbtn").click(function() { - var parts = getPathParts($("img#contentimg").attr("src")); - var pred = null; - $("div.thumbnail img").each(function() { - var thumbparts = getPathParts(this.src); - if (thumbparts.basename == parts.basename) { - pred = thumbparts; - } else if (pred != null) { - updateContentImage(thumbparts); - pred = null; + $("div.thumbnail img").each(function(i) { + var curparts = getPathParts($("img#contentimg").attr("src")); + var myparts = getPathParts($(this).attr("src")); + if ((curparts.gallery == myparts.gallery) && + (curparts.filename == myparts.filename)) { + var matched = $("div.thumbnail img"); + var nextparts; + if (i < matched.length-1) { + nextparts = getPathParts( + $(matched.get(i+1)).attr("src")); + } else { + nextparts = getPathParts( + $(matched.get(0)).attr("src")); + } + updateContentImage(nextparts); + return false; } }); }); diff --git a/submenu.php b/submenu.php deleted file mode 100644 index 21fbbd3..0000000 --- a/submenu.php +++ /dev/null @@ -1,27 +0,0 @@ - - * Jan Dittberner IT-Consulting & -Solutions - * Cottbuser Str. 1, D-01129 Dresden - * - * Copyright (c) 2008 Jeremias Arnstadt - * - * This file is part of the ScrollingJQueryGallery component of the - * gnuviech-server.de Websitetools - * - * ScrollingJQueryGallery is free software: you can redistribute it - * and/or modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * ScrollingJQueryGallery is distributed in the hope that it will be - * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ScrollingJQueryGallery. If not, see - * . - * - * Version: $Id$ - */