Permalink
Browse files

Convert to pathinfo() usage to get extension easier.

  • Loading branch information...
1 parent e4d97d6 commit 996cc047f8fa58bdcd9d198be5a7124c4d2e0567 @sofar committed Oct 8, 2012
Showing with 12 additions and 7 deletions.
  1. +12 −7 db.php
View
19 db.php
@@ -90,16 +90,21 @@
$image = readdir($ih);
continue;
}
- if ((!is_file($d . "/" . $album . "/" . $image)) ||
- (preg_match('/[.]avi$/', $image)) ||
- (preg_match('/[.]AVI$/', $image)) ||
- (preg_match('/[.]thm$/', $image)) ||
- (preg_match('/[.]THM$/', $image)) ||
- (preg_match('/[.]nef$/', $image)) ||
- (preg_match('/[.]NEF$/', $image))) {
+ if (!is_file($d . "/" . $album . "/" . $image)) {
$image = readdir($ih);
continue;
}
+
+ # ignore a few filetypes.
+ $pi = pathinfo($image);
+ switch(strtolower($pi['extension'])) {
+ case 'avi':
+ case 'thm':
+ case 'nef':
+ $image = readdir($ih);
+ continue;
+ }
+
$a .= "{ name: '" . $image . "'";
# store original date of the file

0 comments on commit 996cc04

Please sign in to comment.