Created
February 20, 2015 09:05
-
-
Save iredun/8a218cf0f5a2a6b12568 to your computer and use it in GitHub Desktop.
Script scan photo on dir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$patch=$_SERVER["DOCUMENT_ROOT"]."/bitrix/script foto/News foto/".$dt."/".$nub."/"; | |
$source = str_replace($_SERVER["DOCUMENT_ROOT"], "/", $patch); | |
$f = scandir($patch); | |
foreach ($f as $file){ | |
if (!(preg_match('/\.(jpg)/', $file) || preg_match('/\.(JPG)/', $file))) { | |
$key = array_search($file, $f); | |
if ($key !== false){ | |
unset($f[$key]); | |
} | |
} else { | |
$html.='<a href="'.$source.''.$file.'" rel="lightbox[roadtrip]" ><img src="'.$source.'small/'.$file.'" border="0" /></a> '; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment