Ejemplo n.º 1
0
            imagepng($simg, $thumb_file_path);
            break;
        case 'bmp':
            imagewbmp($simg, $thumb_file_path, 90);
            break;
        default:
            die("不支持的文件类型");
            exit;
    }
    if (move_uploaded_file($tmp_name, $file_path) === false) {
        //开始移动
        exit("返回错误: 上傳文件失败。({$file_name})");
    }
    $uptime = mktime();
    $real_path = str_replace('\\', '/', realpath($file_path));
    if (!$db->insert('th_uploads', 'name,path,url,thumb,type,size,uptime', "'{$file_name}','{$real_path}','{$file_url}','{$thumb_file_url}','{$file_ext}','{$file_size}','{$uptime}'")) {
        echo $file_name . '上傳失败';
    } else {
        echo '<li class="imglist"><a href="' . HOST . $file_url . '" rel="single" class="pirobox"><img src="' . HOST . $file_url . '"/></a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="del_img(' . mysql_insert_id() . ');" class="delimg" id="' . mysql_insert_id() . '">Delete</a><p><span>Chinese:</span><input class="intro" name="' . mysql_insert_id() . '"/></p><p><span>Chinese Url:</span><input class="url" name="l' . mysql_insert_id() . '"/></p><p><span>English:</span><input class="intro" name="e' . mysql_insert_id() . '"/></p><p><span>English Url:</span><input class="url" name="el' . mysql_insert_id() . '"/></p><p><span>Sequence:</span><input class="url" name="ord' . mysql_insert_id() . '"/></p><span class="ts"></span></li>';
    }
}
function filekzm($a)
{
    $c = strrchr($a, '.');
    if ($c) {
        return $c;
    } else {
        return '';
    }
}
function getGet($v)