Jump to content
WebFlake
  • 0

Right Click Images


Reptiles

Question

2 answers to this question

Recommended Posts

  • 0

add the code below to the top of your skins globaltemplate. It will stop all but admins from using right click.

acp > Look & Feel  >  Manage Skin Sets & Templates  >  Manage TemplatesGlobal Templates > globaltemplate
<if test="!in_array($this->memberData['member_group_id'],array(4,6))">
<script language=JavaScript>
var message="Right click is unavailable on the website!";

function clickIE(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS(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=clickNS;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE;
}
document.oncontextmenu=new Function("alert(message);return false")
</script>
</if>

Or if you don't want to show a message change this line 

document.oncontextmenu=new Function("alert(message);return false")

to this

document.oncontextmenu=new Function("return false")
Edited by Lock Down
  • Upvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...