coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Master-D on July 03, 2006, 10:59:38 AM

Title: NO RIGHT CLICK
Post by: Master-D on July 03, 2006, 10:59:38 AM
hey i just did this and it works a treat, it stops anybody right clicking to copy your pictures, not just in the gallery but the external picture viewer, ;) ok heres how you do it.
1st go into your gallery folder and open the displayimage.php and add : -
Quote<script language="JavaScript">
<!--
/*
*/

var message="Hey YOU!\nStop Stealing my pictures or\nFACE THE PUNISHMENT!"



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>
place this code directly @ the top b4 the <?PHP

2nd goto your selected them in GALLERY/THEMES/*******
and open the template.html
and place the same code in @ the BOTTOM
BETWEEN THE */     and the </body>
Quotegood luck peeps
8)
Title: Re: NO RIGHT CLICK
Post by: Vargha on July 03, 2006, 01:13:22 PM
thanks for sharing, it has been done before i think
Title: Re: NO RIGHT CLICK
Post by: Nibbler on July 03, 2006, 01:37:27 PM
It is not a good idea to blindly post code into php files, this can cause problems with cookies and other headers.
Title: Re: NO RIGHT CLICK
Post by: Joachim Müller on July 04, 2006, 08:16:39 AM
No right-click scripts are just plain silly. Please search the board to find out why.