Thread: Protect Images
View Single Post
Old 26-11-2004, 12:48   #3
SMHarman
Inactive
 
Join Date: Jun 2003
Services: Cablevision
Posts: 8,305
SMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronze
SMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronzeSMHarman is cast in bronze
Re: Protect Images

Javascript to change the rightclick of the mouse.
PHP Code:
  <script language=javascript>var clickmessage='Copyright 2003 News Group Newspapers Ltd and/or its licensors. No use without permission. Contact [email]enquiries@nisyndication.com[/email]'
    
function disableclick(e) {
        if (
document.all) {
        if (
event.button==2||event.button==3) {
        if (
event.srcElement.tagName=='IMG'){
        
alert(clickmessage);
        return 
false;
        }
        }
    } else if (
document.layers) {
        if (
e.which == 3) {
        
alert(clickmessage);
        return 
false;
        }
    } else if (
document.getElementById) {
        if (
e.which==3&&e.target.tagName=='IMG'){
        
alert(clickmessage)
        return 
false;
        }
        }
    }
    function 
associateimages() {
        for(
i=0i<document.images.length;i++) {
            
document.images[i].onmousedown=disableclick;
        }
    }
    if (
document.all) {
        
document.onmousedown=disableclick
    
} else if (document.getElementById) {
        
document.onmouseup=disableclick
    
} else if (document.layers) {
        
associateimages()
    }
</
script
Is the one associated newspapers use to do it.

But in any case it's a bit of a waste of time as the images are cached on the users PC and anyone with some nouse, or the right firefox addin can capture them all anyway.
SMHarman is offline   Reply With Quote