Exemplo n.º 1
0
 function isImageFile($afile)
 {
     // Added by hoshiba-farm.com  2006.03.02
     $t = "/^" . ereg_replace("/", "\\/", XOOPS_ROOT_PATH) . ereg_replace("/", "\\/", $GLOBALS['BlogCNF']['thumb_dir']) . "(.+\\.(gif|jpe?g|png|bmp)\$)/i";
     $o = "/^" . ereg_replace("/", "\\/", XOOPS_ROOT_PATH) . ereg_replace("/", "\\/", $GLOBALS['BlogCNF']['img_dir']) . "(.+\\.(gif|jpe?g|png|bmp)\$)/i";
     if (preg_match($t, $afile, $ss) || preg_match($o, $afile, $ss)) {
         $res = download::get_original_name($ss[count($ss) - 2]);
         // thumbnail file
     } else {
         $res = null;
     }
     return $res;
 }