Scrolling jQuery Gallery
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7KB

  1. <?php
  2. /**
  3. * @file
  4. * Behandlung von AJAX-Requests.
  5. *
  6. * @author Jan Dittberner <jan@dittberner.info>
  7. * @version \$Id$
  8. *
  9. * Copyright (c) 2007, 2008 Jan Dittberner <jan@dittberner.info>
  10. * Jan Dittberner IT-Consulting & -Solutions,
  11. * Cottbuser Str. 1, D-01129 Dresden
  12. *
  13. * This file is part of the ScrollingJQueryGallery component of the
  14. * gnuviech-server.de Websitetools
  15. *
  16. * ScrollingJQueryGallery is free software: you can redistribute it
  17. * and/or modify it under the terms of the GNU General Public
  18. * License as published by the Free Software Foundation, either
  19. * version 3 of the License, or (at your option) any later version.
  20. *
  21. * ScrollingJQueryGallery is distributed in the hope that it will be
  22. * useful, but WITHOUT ANY WARRANTY; without even the implied
  23. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  24. * See the GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with ScrollingJQueryGallery. If not, see
  28. * <http://www.gnu.org/licenses/>.
  29. */
  30. /**
  31. * Inkludiert die Funktionsbibliothek.
  32. */
  33. require 'includes/galleryfunctions.php';
  34. if (isset($_GET["imagename"]) && isset($_GET["galleryname"]) &&
  35. preg_match('/^[\w\d _-]+\.jp(e|)g$/', $_GET["imagename"]) &&
  36. preg_match(GALLERY_RE, $_GET["galleryname"])) {
  37. header("Content-Type: text/plain; charset=UTF-8");
  38. if ($imageInfo = getImageInfo($_GET["galleryname"], $_GET["imagename"])) {
  39. print json_encode($imageInfo);
  40. } else {
  41. header("HTTP/1.0 404 Not Found");
  42. header("Status: 404 Not Found");
  43. }
  44. } else {
  45. header("HTTP/1.0 400 Bad Request");
  46. header("Status: 400 Bad Request");
  47. }