Page 1 of 1

How would I add this script to My Site

Posted: Fri May 14, 2010 10:00 am
by Vmal
I am using OpenCart v.1.3.4 and would like to add this script to my site.

Code: Select all

<script language="JavaScript">
<!--
/*
No rightclick script v.2.5
(c) 1998 barts1000
barts1000@aol.com
Don't delete this header!
*/

var message="Sorry, that function is disabled.\nThis Page Copyrighted and\nImages and Text protected!\nALL RIGHTS RESERVED"; 

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --> 

</script>
Does anybody know how this would be done? ??? O0

Re: How would I add this script to My Site

Posted: Fri May 14, 2010 2:59 pm
by dramony
Add it to the header file, catalog>view>theme>DEFAULT>template>common>header.tpl

between:

<script type="text/javascript" src="catalog/view/javascript/jquery/tab.js"></script>
<!-- insert here -->
</head>

Like this:

Code: Select all

<script language="JavaScript">
<!--
/*
No rightclick script v.2.5
(c) 1998 barts1000
barts1000@aol.com
Don't delete this header!
*/

var message="Sorry, that function is disabled.\nThis Page Copyrighted and\nImages and Text protected!\nALL RIGHTS RESERVED";

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->

</script>
</head>

Re: How would I add this script to My Site

Posted: Fri May 14, 2010 9:15 pm
by Vmal
Thank You

Re: How would I add this script to My Site

Posted: Fri May 14, 2010 10:31 pm
by Qphoria
I would recommend that you don't waste your time tho. No Right click scripts are completely circumventable. A person can simply disable javascript or just ALT+PRTSCN to copy anything they need.