CMS솔루션마켓, 이온디 - 워드프레스, 라이믹스, 카페24, 그누보드, 엑셀

프리랜서 커뮤니티

http://bavotasan.com/2010/add-a-copyright-notice-to-copied-text/

위 사이트에 접속하면 아래와 같은 코드가 있습니다.

<script type="text/javascript"> function addLink() { var body_element = document.getElementsByTagName('body')[0]; var selection; selection = window.getSelection(); var pagelink = "<br /><br /> Read more at: <a href='"+document.location.href+"'>"+document.location.href+"</a><br />Copyright &copy; c.bavota"; // change this if you want var copytext = selection + pagelink; var newdiv = document.createElement('div'); newdiv.style.position='absolute'; newdiv.style.left='-99999px'; body_element.appendChild(newdiv); newdiv.innerHTML = copytext; selection.selectAllChildren(newdiv); window.setTimeout(function() { body_element.removeChild(newdiv); },0); } document.oncopy = addLink; </script>

위 코드를 복사해 자신의 자바스크립트 파일에 붙여넣고 varpagelink 부분을 수정합니다. 이 부분은 복사한 사이트의 URL과 메시지가 출력되는 부분입니다. 제 경우는 아래와 같이 수정했습니다.

 

 272 
function addLink() {
 273 
    var body_element = document.getElementsByTagName('body')[0];
 274 
    var selection;
 275 
    selection = window.getSelection();
 276 
    var pagelink = "<br /><br /> 귀하는 복제를 금지하는 사이트에서 콘텐츠를 복사해 사용하려고 하고 있습니다. 이 콘텐츠를 블로그나 웹사이트 또는 인쇄물의 콘텐츠로 사용하면 저작권 문제로 처벌 받을 수 있습니다. : <a href='"+document.location.href+"'>"+document.location.href+"</a><br />Copyright &copy; 베누시안";
 277 
    var copytext = selection + pagelink;
 278 
    var newdiv = document.createElement('div');
 279 
    newdiv.style.position='absolute';
 280 
    newdiv.style.left='-99999px';
 281 
    body_element.appendChild(newdiv);
 282 
    newdiv.innerHTML = copytext;
 283 
    selection.selectAllChildren(newdiv);
 284 
    window.setTimeout(function() {
 285 
        body_element.removeChild(newdiv);
 286 
    },0);
 287 
}
 288 
document.oncopy = addLink;

내 사이트에서 복사를 하고 자신의 블로그에 붙여넣으면 이미지를 제외한 콘텐츠만 복사되며 하단에 위 메시지가 나타납니다.
 

추천한 사람