MyBB Community Forums

Full Version: how to disable right click
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
how to disable right click plz help urgent
Don't.
what dont
It's really impossible. If someone is determined they will always be able to find a way to rip your images.
but i wanna atleast have right click disabled
Open headerinclude template (ACP -> templates and styles -> templates -> <your theme template set-> ungrouped templates -> headerinclude) and paste

<SCRIPT TYPE="text/javascript"> 
<!-- 
//Disable right click script 
//visit http://www.rainbow.arch.scriptmania.com/scripts/ 
var message="Sorry, right-click has been disabled"; 
/////////////////////////////////// 
function clickIE() {if (document.all) {(message);return false;}} 
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {(message);return false;}}} 
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 
document.oncontextmenu=new Function("return false") 
// --> 
</SCRIPT>

save it.
All someone needs to do is turn off javascript and right click will work again. If you don't want people to be able to copy stuff from your site then the solution is to not have a site to begin with. You can't stop it.
It's not like ctrl+C doesn't work. Nobody likes a site like that.
Watermark your images, thats probably your best solution.
Just know that the images were yours to start with. If you have a problem with them doing it then report them for copyright infringement... there is no way you can stop it happening though... otherwise the web would be a lot of a nicer place.
Pages: 1 2