Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Right Click Protection Script
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=649
Page 1 of 1

Author:  chigley [ 27. Nov 2006, 19:59 ]
Post subject:  Right Click Protection Script

Just set up my site at http://www.austin-thomas.co.uk (still needs lots doing to it) and was wondering where in which pages to paste the following script as an echo to protect the site from being right clicked on in 70% of most browsers.

I tried
Code:
echo "<script language=JavaScript>";
echo "<!--";
echo 'var message="Please email austin@austin-thomas.co.uk if you would like to use this image.";';
echo "function clickIE4(){";
echo "if (event.button==2){";
echo 'alert(message);';
echo "return false;";
echo "}";
echo "}";
echo "function clickNS4(e){";
echo "if (document.layers||document.getElementById&&!document.all){";
echo "if (e.which==2||e.which==3){";
echo "alert(message);";
echo "return false;";
echo "}";
echo "}";
echo "}";
echo "if (document.layers){";
echo "document.captureEvents(Event.MOUSEDOWN);";
echo "document.onmousedown=clickNS4;";
echo "}";
echo "else if (document.all&&!document.getElementById){";
echo "document.onmousedown=clickIE4;";
echo "}";
echo 'document.oncontextmenu=new Function("alert(message);return false")';
echo "// --> ";
echo "</script>";
in index.php but it wasn't working at all and if I put it in image.php it just messes the whole thing up!

Please advise,

Charlie

Author:  TinyWebGallery [ 27. Nov 2006, 21:59 ]
Post subject: 

Hi put

var message="Right Click Disabled! If you need to refreash this screen hit the 'F5' key on your keyboard. Copyright(c) Don Pound Studio, All Rights Reserved";

///////////////////////////////////
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")


at the bottom of js/twg.js.php ;).

But you know that this really useless - everyone who can turn off Javascript can still copy the pics ....

/Michael

Author:  chigley [ 28. Nov 2006, 14:36 ]
Post subject: 

Yeah I know it's useless... I will be using other protection methods too. This one stops 70% of the dummies anyway. Firefox automatically disables these types of scripts for me anyway!

Many thanks, great support!

C.>

EDIT: Is there any way this will work for the full screen images on image.php after you click them in the gallery?[

Author:  TinyWebGallery [ 28. Nov 2006, 14:49 ]
Post subject: 

no-

You can turn of Javascript anytime without problems -
if someone turns if off before the popup won't open - but if he does it afterwards ... no way.

(Invisible) Watermarks are th only way I can think of.
#removed_broken_link

/Michael

Author:  chigley [ 28. Nov 2006, 19:57 ]
Post subject: 

So it's not possible to make the script run on the full screen image page, even though it's useless?

Author:  TinyWebGallery [ 29. Nov 2006, 01:18 ]
Post subject: 

oh - sure you can - put it in i_frame/i_popup.php

/Michael

Author:  chigley [ 29. Nov 2006, 23:32 ]
Post subject: 

Thanks, do you know of any free invisible watermarking applications or any other protection methods?

Chigs

Author:  TinyWebGallery [ 30. Nov 2006, 01:38 ]
Post subject: 

sorry - haven't done anything in this direction - ask google ;).

Author:  chigley [ 30. Nov 2006, 09:05 ]
Post subject: 

Will do, thanks a million for your help. Excellent support!

C.>

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/