에디터 이미지 업로드 권한을 파일 업로드 권한과 동일하게 주기
보통 파일 업로드 권한은 관리자 설정에서 정해주지만
에디터에서의 이미지 업로드 권한은 에디터를 쓰는 권한을 가진 회원은 누구나가 가능합니다.
아래의 코드를 write.skin.php 의 적당한 곳에 입력하면
이미지 업로드 버튼이 파일 업로드 권한을 가진 사람에게만 보여집니다.
기본코어를 건드리지 않고 에디터 로딩 후 동적으로 버튼을 보이지 않게 하였습니다.
단 이 코드는 smarteditor2 와 cheditor5 에만 적용됩니다.
[code]
<?php
if ($is_dhtml_editor && $member['mb_level'] < $board['bo_upload_level']) {
echo "<script>function noUpload() {";
if ($config['cf_editor'] == "smarteditor2") echo "wr_content.nextSibling.onload = function() {this.contentWindow.document.getElementsByClassName('se2_multy')[0].style.display = 'none';}";
else if ($config['cf_editor'] == "cheditor5") echo "document.getElementsByName('Image')[0].style.display = 'none';";
echo "} document.addEventListener('DOMContentLoaded', noUpload);</script>";
}
?>
[/code]
댓글 8개
감사합니다. 별루 멋진 팁 아니에요.ㅋ
감사합니다.
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2604 | 8개월 전 | 673 | ||
| 2603 | 8개월 전 | 732 | ||
| 2602 | 8개월 전 | 648 | ||
| 2601 |
|
8개월 전 | 670 | |
| 2600 |
|
8개월 전 | 579 | |
| 2599 | 8개월 전 | 808 | ||
| 2598 | 8개월 전 | 602 | ||
| 2597 |
다케미카코
|
8개월 전 | 755 | |
| 2596 | 8개월 전 | 854 | ||
| 2595 |
|
8개월 전 | 446 | |
| 2594 | 8개월 전 | 608 | ||
| 2593 |
만두먹고또먹고
|
9개월 전 | 935 | |
| 2592 | 9개월 전 | 609 | ||
| 2591 | 9개월 전 | 620 | ||
| 2590 | 9개월 전 | 688 | ||
| 2589 |
|
9개월 전 | 757 | |
| 2588 | 9개월 전 | 476 | ||
| 2587 | 9개월 전 | 796 | ||
| 2586 | 9개월 전 | 642 | ||
| 2585 | 9개월 전 | 509 | ||
| 2584 | 9개월 전 | 576 | ||
| 2583 | 9개월 전 | 498 | ||
| 2582 | 9개월 전 | 640 | ||
| 2581 | 9개월 전 | 598 | ||
| 2580 |
만두먹고또먹고
|
9개월 전 | 517 | |
| 2579 |
|
9개월 전 | 664 | |
| 2578 | 9개월 전 | 646 | ||
| 2577 | 9개월 전 | 625 | ||
| 2576 | 9개월 전 | 561 | ||
| 2575 |
이슈DEV
|
10개월 전 | 993 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기