Jump to content
WebFlake

Disable Right Click For Guests


-Cookie-

Recommended Posts

This tutorial will disable right click on your site for guests only!

 

Just add that code at the very top of your ACP > look & Feel > Skin name > Global Template > defaultHeader

 

 

<if test="IPSMember::isInGroup( $this->memberData, array(2) )">
<script language=JavaScript>
var message="You Must Log-in before you can use Right Click!";

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>
</if>

To Change what the message says all you need to do is Edit this part of the codes "You Must Log-in before you can use Right Click!"

 

And if your wanna add different groups to the code just go to this

 

<if test="IPSMember::isInGroup( $this->memberData, array(2) )">

and where it says 0 add your groups like this 2,4,12 etc....

  • Upvote 7
Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...
  • 2 months later...
  • 1 month later...
  • 2 weeks later...
  • 2 weeks later...
  • 3 weeks later...
  • 3 weeks later...
  • 2 weeks later...
×
×
  • Create New...