Want more features on Pastebin? Sign Up, it's FREE!
Guest

MiniGal Nano 0.3.5 SSE2 patch

By: a guest on Jul 14th, 2011  |  syntax: Diff  |  size: 2.08 KB  |  views: 185  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --- index.php   2010-12-15 09:35:44.000000000 +0100
  2. +++ index.php   2011-07-15 05:26:06.000000000 +0200
  3. @@ -63,6 +63,10 @@
  4.         $display_exif = 0;
  5.      $messages = "Error: PHP EXIF is not available. Set $display_exif = 0; in config.php to remove this message";
  6.  }
  7. +if (!extension_loaded('gd')) {
  8. +    $messages = "Warning: PHP GD extension is not available/loaded. Thumbs disabled.";
  9. +    $label_loading = "GD not available!";
  10. +}
  11.  
  12.  //-----------------------
  13.  // FUNCTIONS
  14. @@ -145,7 +149,8 @@
  15.  //}
  16.  
  17.  if (!defined("GALLERY_ROOT")) define("GALLERY_ROOT", "");
  18. -$thumbdir = rtrim('photos' . "/" .$_REQUEST["dir"],"/");
  19. +if ( ! isset($_GET["dir"]) ) { $_GET["dir"] = ''; }
  20. +$thumbdir = rtrim('photos' . "/" .$_GET["dir"],"/");
  21.  $thumbdir = str_replace("/..", "", $thumbdir); // Prevent looking at any up-level folders
  22.  $currentdir = GALLERY_ROOT . $thumbdir;
  23.  
  24. @@ -207,7 +212,7 @@
  25.                 }
  26.         }
  27.         fclose($file_handle);
  28. -}
  29. +} else $img_captions[$file] = $file;
  30.  
  31.  // 3. LOAD FILES
  32.                         if ($file != "." && $file != ".." && $file != "folder.jpg")
  33. @@ -279,6 +284,7 @@
  34.  //-----------------------
  35.  // OFFSET DETERMINATION
  36.  //-----------------------
  37. +       if ( ! isset($_GET["page"]) ) { $_GET["page"] = 1; }
  38.         $offset_start = ($_GET["page"] * $thumbs_pr_page) - $thumbs_pr_page;
  39.         if (!isset($_GET["page"])) $offset_start = 0;
  40.         $offset_end = $offset_start + $thumbs_pr_page;
  41. @@ -316,7 +322,7 @@
  42.  if ($_GET['dir'] != "")
  43.  {
  44.         $breadcrumb_navigation .= "<a href='?dir='>" . $label_home . "</a> > ";
  45. -       $navitems = explode("/", $_REQUEST['dir']);
  46. +       $navitems = explode("/", $_GET['dir']);
  47.         for($i = 0; $i < sizeof($navitems); $i++)
  48.         {
  49.                 if ($i == sizeof($navitems)-1) $breadcrumb_navigation .= $navitems[$i];
  50. @@ -366,6 +372,7 @@
  51.  }
  52.  
  53.  //Include hidden links for all images AFTER current page so lightbox is able to browse images on different pages
  54. +if ( $i >= 0 )
  55.  for ($y = $i; $y < sizeof($files); $y++)
  56.  {     
  57.         $page_navigation .= "<a href='" . $currentdir . "/" . $files[$y]["name"] . "' rel='lightbox[billeder]'  class='hidden' title='" . $img_captions[$files[$y]["name"]] . "'></a>";
clone this paste RAW Paste Data