(로또팁)첨부화일 갯수만큼 입력폼 뿌려주기
해당 write.skin.php을 바꾸어 줍니다..
수정전 :
<? if ($is_file) { ?>
<tr>
<td style='padding-left:20px; height:30px;'><table cellpadding=0 cellspacing=0><tr><td style=" padding-top: 10px;">· 파일 <span onclick="add_file();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>+</span> <span onclick="del_file();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>-</span></td></tr></table></td>
<td style='padding:5 0 5 0;'><table id="variableFiles" cellpadding=0 cellspacing=0></table><?// print_r2($file); ?>
<script language="JavaScript">
var flen = 0;
function add_file(delete_code)
{
var upload_count = <?=(int)$board[bo_upload_count]?>;
if (upload_count && flen >= upload_count)
{
alert("이 게시판은 "+upload_count+"개 까지만 파일 업로드가 가능합니다.");
return;
}
<tr>
<td style='padding-left:20px; height:30px;'><table cellpadding=0 cellspacing=0><tr><td style=" padding-top: 10px;">· 파일 <span onclick="add_file();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>+</span> <span onclick="del_file();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>-</span></td></tr></table></td>
<td style='padding:5 0 5 0;'><table id="variableFiles" cellpadding=0 cellspacing=0></table><?// print_r2($file); ?>
<script language="JavaScript">
var flen = 0;
function add_file(delete_code)
{
var upload_count = <?=(int)$board[bo_upload_count]?>;
if (upload_count && flen >= upload_count)
{
alert("이 게시판은 "+upload_count+"개 까지만 파일 업로드가 가능합니다.");
return;
}
var objTbl;
var objRow;
var objCell;
if (document.getElementById)
objTbl = document.getElementById("variableFiles");
else
objTbl = document.all["variableFiles"];
var objRow;
var objCell;
if (document.getElementById)
objTbl = document.getElementById("variableFiles");
else
objTbl = document.all["variableFiles"];
objRow = objTbl.insertRow(objTbl.rows.length);
objCell = objRow.insertCell(0);
objCell = objRow.insertCell(0);
objCell.innerHTML = "<input type='file' class='field_pub_01' name='bf_file[]' title='파일 용량 <?=$upload_max_filesize?> 이하만 업로드 가능'>";
if (delete_code)
objCell.innerHTML += delete_code;
else
{
<? if ($is_file_content) { ?>
objCell.innerHTML += "<br><input type='text' class='field_pub_01' size=50 name='bf_content[]' title='업로드 이미지 파일에 해당 되는 내용을 입력하세요.'>";
<? } ?>
;
}
if (delete_code)
objCell.innerHTML += delete_code;
else
{
<? if ($is_file_content) { ?>
objCell.innerHTML += "<br><input type='text' class='field_pub_01' size=50 name='bf_content[]' title='업로드 이미지 파일에 해당 되는 내용을 입력하세요.'>";
<? } ?>
;
}
flen++;
}
}
<?=$file_script; //수정시에 필요한 스크립트?>
function del_file()
{
// file_length 이하로는 필드가 삭제되지 않아야 합니다.
var file_length = <?=(int)$file_length?>;
var objTbl = document.getElementById("variableFiles");
if (objTbl.rows.length - 1 > file_length)
{
objTbl.deleteRow(objTbl.rows.length - 1);
flen--;
}
}
</script></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>
{
// file_length 이하로는 필드가 삭제되지 않아야 합니다.
var file_length = <?=(int)$file_length?>;
var objTbl = document.getElementById("variableFiles");
if (objTbl.rows.length - 1 > file_length)
{
objTbl.deleteRow(objTbl.rows.length - 1);
flen--;
}
}
</script></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>
수정후 :
<? if ($is_file) { ?>
<tr>
<td style='padding-left:20px; height:30px;'><table cellpadding=0 cellspacing=0><tr><td style=" padding-top: 10px;">· 파일 <span onclick="add_file();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>+</span> <span onclick="del_file();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>-</span></td></tr></table></td>
<td style='padding:5 0 5 0;'><table id="variableFiles" cellpadding=0 cellspacing=0></table><?// print_r2($file); ?>
<script language="JavaScript">
var flen = 0;
function add_file(delete_code)
{
var upload_count = <?=(int)$board[bo_upload_count]?>;
if (upload_count && flen >= upload_count)
{
alert("이 게시판은 "+upload_count+"개 까지만 파일 업로드가 가능합니다.");
return;
}
<tr>
<td style='padding-left:20px; height:30px;'><table cellpadding=0 cellspacing=0><tr><td style=" padding-top: 10px;">· 파일 <span onclick="add_file();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>+</span> <span onclick="del_file();" style='cursor:pointer; font-family:tahoma; font-size:12pt;'>-</span></td></tr></table></td>
<td style='padding:5 0 5 0;'><table id="variableFiles" cellpadding=0 cellspacing=0></table><?// print_r2($file); ?>
<script language="JavaScript">
var flen = 0;
function add_file(delete_code)
{
var upload_count = <?=(int)$board[bo_upload_count]?>;
if (upload_count && flen >= upload_count)
{
alert("이 게시판은 "+upload_count+"개 까지만 파일 업로드가 가능합니다.");
return;
}
var objTbl;
var objRow;
var objCell;
if (document.getElementById)
objTbl = document.getElementById("variableFiles");
else
objTbl = document.all["variableFiles"];
var objRow;
var objCell;
if (document.getElementById)
objTbl = document.getElementById("variableFiles");
else
objTbl = document.all["variableFiles"];
objRow = objTbl.insertRow(objTbl.rows.length);
objCell = objRow.insertCell(0);
objCell = objRow.insertCell(0);
objCell.innerHTML = "<input type='file' class='field_pub_01' name='bf_file[]' title='파일 용량 <?=$upload_max_filesize?> 이하만 업로드 가능'>";
if (delete_code)
objCell.innerHTML += delete_code;
else
{
<? if ($is_file_content) { ?>
objCell.innerHTML += "<br><input type='text' class='field_pub_01' size=50 name='bf_content[]' title='업로드 이미지 파일에 해당 되는 내용을 입력하세요.'>";
<? } ?>
;
}
if (delete_code)
objCell.innerHTML += delete_code;
else
{
<? if ($is_file_content) { ?>
objCell.innerHTML += "<br><input type='text' class='field_pub_01' size=50 name='bf_content[]' title='업로드 이미지 파일에 해당 되는 내용을 입력하세요.'>";
<? } ?>
;
}
flen++;
}
}
<?=$file_script; //수정시에 필요한 스크립트?>
function del_file()
{
// file_length 이하로는 필드가 삭제되지 않아야 합니다.
var file_length = <?=(int)$file_length?>;
var objTbl = document.getElementById("variableFiles");
if (objTbl.rows.length - 1 > file_length)
{
objTbl.deleteRow(objTbl.rows.length - 1);
flen--;
}
}
<? if($w=="") {
for($j=1; $j < $board[bo_upload_count]; $j++){ ?>
add_file();
<? }
} ?>
</script></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>
{
// file_length 이하로는 필드가 삭제되지 않아야 합니다.
var file_length = <?=(int)$file_length?>;
var objTbl = document.getElementById("variableFiles");
if (objTbl.rows.length - 1 > file_length)
{
objTbl.deleteRow(objTbl.rows.length - 1);
flen--;
}
}
<? if($w=="") {
for($j=1; $j < $board[bo_upload_count]; $j++){ ?>
add_file();
<? }
} ?>
</script></td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
<? } ?>
추가된 부분은
<? if($w=="") {
for($j=1; $j < $board[bo_upload_count]; $j++){ ?>
add_file();
<? }
} ?>
for($j=1; $j < $board[bo_upload_count]; $j++){ ?>
add_file();
<? }
} ?>
로 필요시 $board[bo_upload_count]; 를 숫자로 표현 하셔도 됩니다....
예) 폼은 2개만 보이고 업로드 수는 5라도 위에
$board[bo_upload_count]; 를 2로 바꾸어 두면 폼은 2개만 보이고 추가 버튼으로 추가가 가능합니다....
태클은 절대 사절......
추천은 필수~~~~~~^^
퍼가실때는 필히 출처를 밝혀 주십시오.
댓글 8개
18년 전
알랍! 땡수~ 땡수~~ ^0^/
18년 전
로또팁이라는건 즉 어떻게 쓰느냐에 따라 기본에서 더 얻느냐, 그냥 기본으로 가게되나 둘중 하나라는 팁이라는 거군요
TOGETHER
18년 전
사용자의 활용여부에 따라 달라질 수 있다는 뜻 입니다....^^
18년 전
감사합니다.
raineye
18년 전
감사합니다~
18년 전
basic 테스트 아무 변화가 없는것 같은데여~~...
18년 전
<? if($w=="") { for($j=1; $j < $board[bo_upload_count]; $j++){ ?>
add_file();
<? } } ?>
<? if($w=="u") { for($j=$file[count]; $j < $board[bo_upload_count]; $j++){ ?>
add_file();
<? } } ?>
add_file();
<? } } ?>
<? if($w=="u") { for($j=$file[count]; $j < $board[bo_upload_count]; $j++){ ?>
add_file();
<? } } ?>
deaf1
13년 전
와 감사합니다!!
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3309 | 3년 전 | 1798 | ||
| 3308 | 11년 전 | 2087 | ||
| 3307 |
uPAmJ903
|
6년 전 | 4742 | |
| 3306 |
바른사나이
|
6년 전 | 3269 | |
| 3305 | 6년 전 | 12297 | ||
| 3304 | 7년 전 | 3699 | ||
| 3303 | 7년 전 | 3736 | ||
| 3302 |
지리산초보
|
7년 전 | 13589 | |
| 3301 |
sozet
|
8년 전 | 4897 | |
| 3300 |
sozet
|
8년 전 | 5963 | |
| 3299 |
sozet
|
8년 전 | 10855 | |
| 3298 | 8년 전 | 4008 | ||
| 3297 |
또치하우스
|
8년 전 | 4434 | |
| 3296 | 8년 전 | 11961 | ||
| 3295 |
또치하우스
|
8년 전 | 14978 | |
| 3294 | 8년 전 | 6016 | ||
| 3293 | 8년 전 | 5583 | ||
| 3292 |
|
9년 전 | 5309 | |
| 3291 | 9년 전 | 13673 | ||
| 3290 | 9년 전 | 5043 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기