if ($orfile == 4) { $rawfile = ".bintro.jpg"; } #Thumbnail Generate $singlbackground = ""; if (file_exists("./.pic_.bintro.jpg.jpg") && $mode == 'dmyma') { $endthumb = "."; } if (!file_exists($folder . "/.pic_" . $file . ".jpg")) { if (preg_match('/\\.mp4\\z/i', $file) || preg_match('/\\.webm\\z/i', $file) || preg_match('/\\.mkv\\z/i', $file)) { exec('ffmpeg -i "' . $folder . '/' . $file . '" -y -vcodec mjpeg -vframes 1 -an -f rawvideo -s 238x150 -ss 00:00:05 "' . $folder . '/.pic_' . $file . '.jpg" > /dev/null &'); } elseif (preg_match('/\\.jpg\\z/i', $file) || preg_match('/\\.png\\z/i', $file) || preg_match('/\\.gif\\z/i', $file)) { pic_thumb($folder . '/' . $file, $folder . '/.pic_' . $file . '.jpg', '238', '150'); } elseif (preg_match('/\\.mp3\\z/i', $file) || preg_match('/\\.aac\\z/i', $file) || preg_match('/\\.rdio\\z/i', $file)) { if (file_exists($folder . "/.art_" . $file . ".jpg")) { pic_thumb($folder . '/.art_' . $file . '.jpg', $folder . '/.pic_' . $file . '.jpg', '238', '150'); } } if (!file_exists($folder . "/.pic_" . $file . ".jpg")) { $singlbackground = $endthumb . "/.pic_.bintro.jpg.jpg"; } } else { $singlbackground = $rawfolder . "/.pic_" . $rawfile . ".jpg"; } $yeslo = implode('/', explode('%2F', rawurlencode($folder . "/" . $file))); $mpf = explode('.', $file); $mpz = count($mpf); if ($mpz == 1) { $mpr = $file; } $mpz = implode('.', array_slice($mpf, 0, $mpz - 1));
switch ($file_info[2]) { case 1: imagegif($logo_img, $pic_file); break; case 2: imagejpeg($logo_img, $pic_file); break; case 3: imagepng($logo_img, $pic_file); break; } } } //缩略图 if ($first_pic && $i == 0 && empty($thumb)) { $thumb = pic_thumb($pic_file, $_sys['thump_width'], $_sys['thump_height'], $pic_dir); } $i = $i + 1; } } $body = addslashes($body); $fields['content'] = $body; } //编辑器处理 $info = $is_info && empty($info) ? cn_substr(strip_tags($fields['content']), 255) : cn_substr($info, 240); $key_words = empty($key_words) ? '' : cn_substr($key_words, 150); $author = empty($author) ? '' : cn_substr($author, 150); $source = empty($source) ? '' : cn_substr($source, 150); $cache_time = empty($cache_time) ? 30 : $cache_time; //缓存时间 //主表