예제 #1
0
 function searchImageString($content)
 {
     $first_img = '';
     ob_start();
     ob_end_clean();
     $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
     if (isset($matches[1][0])) {
         $first_img = $matches[1][0];
     }
     if (empty($first_img) || $first_img == null) {
         $first_img = noImageBig();
     }
     return $first_img;
 }
예제 #2
0
function imagePath($img)
{
    if (!empty($img)) {
        if (ENVIRONMENT == "development") {
            $foldeSite = $img;
            $Ex = explode("/", $foldeSite);
            $siteFolder = $Ex[1];
            $count = strlen($siteFolder);
            $remCount = $count + 2;
            $asset = substr($foldeSite, $remCount);
            return $asset;
        } else {
            return $img;
        }
    } else {
        return noImageBig();
    }
}
예제 #3
0
 function getTheme($type)
 {
     $xPath = locationTheme('path') . $type;
     $xUrl = locationTheme('url') . $type;
     $path = scandir($xPath);
     $dpath = array_diff($path, array('.', '..'));
     $output = array();
     $thumbFile = "thumbnail.jpg";
     foreach ($dpath as $key => $val) {
         $img = '';
         if (getCheckImage($xPath . '/' . $val . '/' . $thumbFile)) {
             $img = $xUrl . '/' . $val . '/' . $thumbFile;
         } else {
             $img = noImageBig();
         }
         $output[] = array('thumb' => $img, 'name' => $val);
     }
     return $output;
 }