I have got thumbnail program, however I couldn't make thumbnail.
$data_path = $g4['path'] . "/data/file/" . $bo_table;
$thumb_path = $data_path . '/thumb_l';
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
for ($i=0; $i<count($list); $i++) {
$no_image = $no_thum."/".$a[$r[$i]];
$dest_link[] = array( 'wr_id' => $list[$i]['wr_id'], 'url' => extract_img($list[$i]['wr_content']));
//print_r2($dest_link[$i]);
$url = $dest_link[$i]['url']['0'];
$save_dir = $thumb_path;
$referer = "";
$thumb = $save_dir . '/s_' . base64_encode($url);
if (!file_exists($thumb)) {
$result = @Ymake_sumnail_remoteimage($url, $save_dir, $w, $h, $referer);
}
$filename = strrchr($url,"/");
$filename = substr($filename, 1);
$filename = urlencode($filename);
print_r($filename); // no.1
if ($list[$i]['file'][0]['file']){
$filename = $list[$i]['file'][0]['file'];
$dest_file = $data_path .'/'. $filename;
print_r($list[$i]['file'][0]['file']); //no.2
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $filename) && file_exists($dest_file)){
$thumb = $thumb_path.'/' . $filename;
if (!file_exists($thumb)){
$size = getimagesize($dest_file);
if ($size[2] == 1)
$src = imagecreatefromgif($dest_file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($dest_file);
else if ($size[2] == 3)
$src = imagecreatefrompng($dest_file);
else
break;
if ($size[0] >= $size[1]){
$rate = $w / $size[0];
$width = $w;
$height = (int)($size[1] * $rate);
}
else{
$rate = $h / $size[1];
$width = (int)($size[0] * $rate);
$height = $h;
}
$dst = imagecreatetruecolor($width, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb, $board['bo_2']);
chmod($thumb, 0707);
}
}
}
At "print_r($filename); // no.1", I can have "47eab0b390c11%26amp%3Bfilename%3D%C0%BD%BC%BA%C1%B6%B0%A2%B0%F8%BF%F8%28080315%29831.jpg"
But at "print_r($list[$i]['file'][0]['file']); //no.2", I cannot see anything.
What am I wrong?