Version: 1.00, by borbole
Developer Last Online: Oct 2015
Category: Mini Mods -
Version: 4.0.2
Rating:
Released: 03-03-2010
Last Update: Never
Installs: 79
Template Edits
Re-useable Code Translations
No support by the author.
This script taken from dynamic drive will disable the right click on your forum for guests. As to offer some protection to your materials being stolen from your forum.
Note: This will prevent them only for the right click and copy/paste directly.
Anyway, add the following code to the very begin of the headinclude template.
Code:
<vb:if condition="$show['guest']">
<script type="text/javascript">
<!--
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
var message="Right click is disabled for guests!";
///////////////////////////////////
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>
</vb:if>
To change the message shown to guests when attempting to right click at your forum, find the following code:
Code:
var message="Right click is disabled for guests!";
And change the text
Code:
Right click is disabled for guests!
with your own message.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Interesting idea, but doesn't work well in newer browser version ...
For example, FireFox 4.01 shows the "block" as in the pic attached, but if the user clicks the checkbox shown, the block doesn't work from then onwards.
Anyway, would be great to have mod like this that would be more effective in blocking guests from capturing copyrighted pics.
Regardless, thanks to the developer here for his efforts in posting this one .. :up:
with this script you can disable text selection. like in the first post you must copy into top of headinclude template. enjoy.
Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">
<script type="text/javascript">
function returnFalse(e){
return false;
}
function cancelEvent(e){
if(e.preventDefault)e.preventDefault();
else e.returnValue=false;
}
function addHandler(e,event,action,param){
if(document.addEventListener)e.addEventListener(event,action,param);
else if(document.attachEvent)e.attachEvent('on'+event,action);
else e['on'+event]=action;
}
function removeHandler(e,event,action,param){
if(document.addEventListener)e.removeEventListener(event,action,param);
else if(document.attachEvent)e.detachEvent('on'+event,action);
else e['on'+event]=returnFalse;
}
addHandler(document,'mousedown',mouseDown,false);
addHandler(document,'mouseup',mouseUp,false);
function mouseDown(e){
// HACK: calling no selection for class name = "handle hover"
//if(e.target.className=="handle hover")
if((e.target.nodeName!="INPUT")&&
(e.target.nodeName!="TEXTAREA")&&
(e.target.nodeName!="H1")&&
(e.target.nodeName!="H2")&&
(e.target.nodeName!="H3")&&
(e.target.nodeName!="P")&&
(e.target.id.substr(0,3)!="lbl")&&
(e.target.id.substr(0,3)!="ttl")
)
{
e=e||event;
cancelEvent(e);
addHandler(document,'selectstart',returnFalse,false);
}
}
function mouseUp(e){
removeHandler(document,'selectstart',returnFalse,false);
}
</script></vb:if>
This code disables the guests from selecting their date of birth on registration. If they click on date etc. it is just blank in google chrome, ie and sometimes firefox. It took me a long time to figure out why all new registrations stopped, nobody could register.