coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: allright on January 18, 2006, 08:37:25 AM

Title: how do i disable right click for 1.4.3
Post by: allright on January 18, 2006, 08:37:25 AM
i have the codes i think but what file do i put the scripts at? themes.php? index.php? so i just need to be pointed in the rigt direction thank you.
Title: Re: how do i disable right click for 1.4.3
Post by: Joachim Müller on January 18, 2006, 08:50:55 AM
depends on how your codes work. I suggest putting it into themes/yourtheme/template.html
Title: Re: how do i disable right click for 1.4.3
Post by: mrand on January 18, 2006, 03:22:17 PM
What is the code? I would love to add this to galleries as well. Thanks.
Title: Re: how do i disable right click for 1.4.3
Post by: allright on January 18, 2006, 05:23:35 PM
i need to find the code as well. i don't know if i should use a javascript or just an html code? i tried putting a couple of codes in the theme.html. thank you
Title: Re: how do i disable right click for 1.4.3
Post by: netfalls on January 18, 2006, 06:08:23 PM
Hi,

Just add this code in your template.html just before the  </head> tag  <script language=JavaScript>
<!--


var message="copyright protected!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>


Title: Re: how do i disable right click for 1.4.3
Post by: Joachim Müller on January 18, 2006, 10:38:56 PM
thanks for sharing, but let me say that the coppermine dev team considers no right click scripts silly and useless. Please search the board for detailed explanations why.