티스토리 뷰
그누보드 4 이하 다중 파일 업로드, 삭제 웹접근성 개선
/bbs/write.php
- id 할당
- label 추가
- 안내 text 인식 개선
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | // 가변 파일 $file_script = "" ; $file_length = -1; // 수정의 경우 파일업로드 필드가 가변적으로 늘어나야 하고 삭제 표시도 해주어야 합니다. if ($w == "u" ) { for ($i=0; $i<$file[count]; $i++) { $row = sql_fetch( " select bf_file, bf_content from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' " ); if ($row[bf_file]) { $file_script .= "add_file(\"<label for=" bf_file_del{$i} " class=" tts ">첨부파일 {$i} 삭제</label> <input type=" checkbox " name=" bf_file_del[$i] " id=" bf_file_del{$i} " value=" 1 " title=" 첨부파일{$i} 삭제 "><a href=" {$file[$i][href]} ">{$file[$i][source]}({$file[$i][size]})</a> 파일 삭제" ; if ($is_file_content) //$file_script .= "<br><input type="text" class="ed" size="50" name="bf_content[$i]" value="{$row[bf_content]}" title="업로드 이미지 파일에 해당 되는 내용을 입력하세요.">"; // 첨부파일설명에서 ' 또는 " 입력되면 오류나는 부분 수정 $file_script .= "<br><label for = "bf_content{$i}" class= "tts" >첨부파일 {$i} 내용</label> <input type= "text" class= "ed" size= "50" name= "bf_content[$i]" id= "bf_content{$i}" value= "".addslashes(get_text($row[bf_content]))."" title= "업로드 이미지 파일 {$i}에 해당 되는 내용을 입력하세요." > "; $file_script .= " \ ");\n" ; } else $file_script .= "add_file('');\n" ; } $file_length = $file[count] - 1; } |
/skin/board/*/write.skin.php
- 중첩 table 문제 개선
- id 할당
- label 추가
- 안내 text 인식 개선
- Javascript jQuery 활용 개선
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | < ul id = "variableFiles" ></ ul > <?// print_r2 ($file); ?> < script type = "text/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 = $("#variableFiles"); var objCell = $("< li ></ li >"); var innerHtml = "< label for = 'bf_file"+ flen +"' class = 'tts' >첨부파일 "+ flen +"</ label > < input size = 50 type = 'file' class = 'field' name = 'bf_file[]' id = 'bf_file"+ flen +"' title='첨부 파일 "+ flen +" 용량 <?=$upload_max_filesize?> 이하만 업로드 가능'>"; if (delete_code) innerHtml += delete_code; else { <? if ($is_file_content) { ?> innerHtml += "< br />< label for = 'bf_content"+ flen +"' class = 'tts' >첨부파일 "+ flen +" 내용</ label > < input type = 'text' class = 'field' size = '50' name = 'bf_content[]' id = 'bf_content"+ flen +"' title = '업로드 이미지 파일"+ flen +"에 해당 되는 내용을 입력하세요.' />"; <? } ?> ; } $(objCell).html(innerHtml).appendTo(objTbl); flen++; } <?=$file_script; //수정시에 필요한 스크립트?> function del_file() { // file_length 이하로는 필드가 삭제되지 않아야 합니다. var file_length = <?=(int)$file_length?>; var objRows = $("#variableFiles li"); var objRows_length = $(objRows).size(); if (objRows_length - 1 > file_length) { $(objRows).eq(objRows_length - 1).remove(); flen--; } } </ script > |
'웹프로그래밍 > PHP' 카테고리의 다른 글
Laravel Framework 설치 (0) | 2015.02.25 |
---|---|
그누보드 Youtube iframe embed code 보이도록 뷰스킨 패치 (0) | 2015.01.29 |
PHP 다국어 지역화 gettext() *.po *.mo (1) | 2015.01.06 |
워드프레스 사이트/경로 이전 (0) | 2014.12.16 |
IIS 워드프레스 고유주소(Permalink) URL 재작성(ReWrite) 설정 (1) | 2014.12.16 |
댓글
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
- Make Use Of
- How to geek
- 인터넷 통계정보 검색시스템
- 트위터 공유 정보모음
- 웹표준KR
- 치우의 컴맹탈출구
- Dev. Cheat Sheets
- w3schools
- Dev. 조각들
- ASP Ajax Library
- CSS Tricks
- WebResourcesDepot
- jQuery Selectors Tester
- DeveloperSnippets
- Smashing Magazine
- Nettuts+
- devListing
- 웹 리소스 사이트(한)
- Mobile tuts+
- Dream In Code
- Developer Tutorials
- CSS3 Previews
- 자북
- 안드로이드 사이드
- Code Visually
- Code School
- SQLer.com
- 무료 파워포인트 템플릿
- iconPot
- Free PowerPoint Templates
- Design Bombs
- Web Designer Wall
- 1st Webdesigner
- Vandelay Design
- 무료 벡터 이미지 사이트들
- Tripwire Magazine
- Web TrendSet
- WebMonkey
- 윤춘근 프리젠테이션 디자이너 블로그
- cz.cc 무료 DNS
- [웹하드] MediaFire
- [웹하드] DivShare
- 한컴 인터넷 오피스
TAG
- nodejs
- ASP
- JSON
- Linux
- Docker
- mssql
- javascript
- laravel
- Prototype
- Mac
- iphone
- centos
- PHP
- CSS
- API
- sencha touch
- 한글
- 워드프레스
- classic asp
- nginx
- JQuery
- Chrome
- IOS
- Android
- Wordpress
- git
- IE
- 안드로이드
- iis
- Debug
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함