테스트 사이트 - 개발 중인 베타 버전입니다

불당썸, 에디터 사용시 썸네일 생성 에러 근본적인 해결방법

· 12년 전 · 6741 · 2
불당썸, 에디터 사용시 썸네일 생성 에러 근본적인 해결방법입니다
보통 크롬으로 글쓸때 이런 오류가 발생하던데요..
img 태그 순서때문에 발생한 오류 인데요
저의 경우를 예로 들자면
크롬에서올릴때는

<img src="http://uani.wowip.kr/data/cheditor4/1301/fbd52e0c2c7b61a501bf424960aecd3f_6wLR6duQjfSSZFKrF.png" width="171" height="200" alt="유애니.png" style="border: none" />

이렇게 src,width,height,alt,style 순으로 나와버려서
리스트에서 $list[$i]["wr_content"] 이걸로 사진을 뽑을때 이미지 주소가
http://uani.wowip.kr/data/cheditor4/1301/fbd52e0c2c7b61a501bf424960aecd3f_6wLR6duQjfSSZFKrF.png" width="171" height="200" alt="유애니.png"
이렇게 나와서 오류가 나버리죠

익스플로러에서 이미지를 올리면
<img width="171" height="200" style="border: currentColor" alt="유애니.png" src="http://uani.wowip.kr/data/cheditor4/1301/fbd52e0c2c7b61a501bf424960aecd3f_yaF3ccsWuEzjMtUNduT.png" />

width,height,style,alt,src 순으로나와서 썸생성이 가능해지죠
그런데 사실 알고보니 익스플로러에서 오류로 썸이 생성되는 거더라구요

cheditor5/cheditor.js에서 2030번째줄 부근을 보면

img.setAttribute('src', attr.src);
img.setAttribute('width', attr.width);
img.setAttribute('height', attr.height);
img.setAttribute('alt', attr.alt ? attr.alt : attr.info.origName);
img.style.border = 'none';

이렇게 되잇어요 순서가 크롬에서 올라가는 순서(src,width,height,alt,style) 그대로죠?
그래서 크롬의 오류가 아니라 익스플로러의 오류로 썸이 생성되는 거라는 걸 알앗어요..
정말.. 싫네요 익스플로러는 하여튼 저걸 순서를 바꿔서

img.setAttribute('width', attr.width);
img.setAttribute('height', attr.height);
img.setAttribute('alt', attr.alt ? attr.alt : attr.info.origName);
img.setAttribute('src', attr.src);
img.style.border = 'none';

이렇게 수정해주면(img.setAttribute('src', attr.src); 이게 4번째 줄로 이동)
width,height,alt,src,style 순으로 배열이 오류가 안나겟죠

이상 php초보의 불당썸, 에디터 사용시 썸네일 생성 에러 해결방법이엇습니다~

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 2개

좋아요~
감사합니다! 이제 잘되네요 ㅜㅜ

게시글 목록

번호 제목
33411
33410
33409
33408
33407
33404
33403
33402
33399
33398
33390
33386
33377
33356
33348
33340
33334
33333
33329
33322