window.resizeTo(가로, 세로);
</script>
현재 윈도우의 사이즈를 조절한다.
물론 팝업창 마지막 스크립트로 실행되게 순차적용을 해야하며,
parent 창에서 팝업창의 이름을 지정해주고 현재 윈도우에서 opener 속성을 가진 모든 윈도우를 컨트롤 가능
function PersonalNo_Check(PersonalNo)
{
// 주민번호의 형태와 7번째 자리(성별) 유효성 검사
fmt = /^\d{6}-[1234]\d{6}$/;
if (!fmt.test(PersonalNo)) {
return false;
}
// 날짜 유효성 검사
birthYear = (PersonalNo.charAt(7) <= "2") ? "19" : "20";
birthYear += PersonalNo.substr(0, 2);
birthMonth = PersonalNo.substr(2, 2) - 1;
birthDate = PersonalNo.substr(4, 2);
birth = new Date(birthYear, birthMonth, birthDate);
if ( birth.getYear() % 100 != PersonalNo.substr(0, 2) ||
birth.getMonth() != birthMonth ||
birth.getDate() != birthDate) {
return false;
}
// Check Sum 코드의 유효성 검사
buf = new Array(13);
for (i = 0; i < 6; i++) buf[i] = parseInt(PersonalNo.charAt(i));
for (i = 6; i < 13; i++) buf[i] = parseInt(PersonalNo.charAt(i + 1));
multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);
if ((11 - (sum % 11)) % 10 != buf[12]) {
return false;
}
return true;
}//PersonalNo_Check(PersonalNo)
호출은 "-" 하이픈 까지 모두 전송
출처 : phpschool.com // 어느 분 자료
var editor = new KEditor(
"contentEditor",
{
lang: "php",
updateDir: "/KEditor/data/editor", //절대경로 표기 할것
topMenus: topMenu
});
</script>
<!-- //Content 입력 내용 부분에 삽입 -->
<?
/* 썸네일 파일 생성 시작*/
function create_thumnail($url, $width=0, $height=0)
{
global $HTTP_SERVER_VARS;
if ($url[0] == "/") $fname = $url;
else $fname = $url;
$imsize = @getimagesize($fname);
if (empty($imsize)) return;
if ($imsize[0] >= 10 && $imsize[1] >= 10) {
if ($width > 0) {
if ($imsize[0] > $width) {
$imsize[1] = intval($imsize[1] * $width / $imsize[0]);
$imsize[0] = $width;
}
}
if ($height > 0) {
if ($imsize[1] > $height) {
$imsize[0] = intval($imsize[0] * $height / $imsize[1]);
$imsize[1] = $height;
}
}
}
//$src = gd_imagecreate($url);
$pos = strrpos($url, ".");
$ext = strtolower(substr($url, $pos + 1));
if ($ext == "jpeg" || $ext == "jpg") $src = imagecreatefromjpeg($url);
else if ($ext == "gif") $src = imagecreatefromgif($url);
else if ($ext == "bmp") $src = imagecreatefromwbmp($url);
else if ($ext == "png") $src = imagecreatefrompng($url);
$dest = imagecreatetruecolor($imsize[0], $imsize[1]);
// 이미지 정보
list($image_width, $image_height) = getimagesize($fname);
@imagecopyresampled($dest, $src, 0, 0, 0, 0, $imsize[0], $imsize[1], $image_width, $image_height);
imagejpeg($dest, $fname);
// echo "<img src='$fname' width='${imsize[0]}' height='${imsize[1]}' border='0'>";
}
/* 썸네일 파일 생성 끝*/
?>
사용시...
//create_thumnail(BBS_DATA_PATH."/".$folder_path."/".$realfile, 540, 0);
create_thumnail(BBS_THUMNAIL_PATH."/".$folder_path."/".$realfile, 138, 0);