X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   disable the copy and paste function (https://forum.x-cart.com/showthread.php?t=10173)

pcarcare 11-03-2004 12:25 AM

disable the copy and paste function
 
does anybody know how to remove the copy and paste function, i.e the right click?

cotc2001 11-03-2004 12:37 AM

try
Code:

{literal}
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
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>
{/literal}

in somewhere like head.tpl or bottom.tpl (or basically any template that is one EVERY page

Kinjal 03-11-2010 11:46 PM

Re: disable the copy and paste function
 
Thanks - just added your code at bottom to 'skin1-customer-home.tpl' and it work for all the pages.

cflsystems 03-12-2010 04:37 AM

Re: disable the copy and paste function
 
That's somehow useless as anyone can just use the browser's menu to copy from the page

balinor 03-12-2010 04:43 AM

Re: disable the copy and paste function
 
Yea, don't bloat your code with that. If you make info/images public, they are going to get swiped from time to time, there is nothing you can do to prevent it.


All times are GMT -8. The time now is 06:36 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.