Replicators
12-22-2005, 02:20 AM
I would like to see a hack to disable right-clicking,but only in posts. I found a hack for phpbb that does it which i will give the code now...
<!-- Start add - No copy MOD -->
<script language="javascript"> <!--
var previous_key ;
function clickIE4(){
if (event.button==2){
alert('No Right Click Is Allowed');
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert('No Right Click Is Allowed');
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
function handleKeyDown()
{
if (previous_key==17 )
{
switch (window.event.keyCode)
{
case 45 :
case 46:
case 67:
case 88:
alert('Copy Is Not Allowed');
event.keyCode=0;
previous_key=window.event.keyCode;
event.returnValue=false;
break;
}
} else if (previous_key==16)
{
switch (window.event.keyCode)
{
case 45 :
case 46:
alert('Copy Is Not Allowed'+window.event.keyCode);
event.keyCode=0;
previous_key=window.event.keyCode;
event.returnValue=false;
break;
}
}
previous_key=window.event.keyCode;
}
function handleKeyUp()
{
previous_key=0;
}
if ( 1 )
{
document.oncontextmenu=new Function("alert('No Right Click Is Allowed');return false")
document.onkeyup = handleKeyUp;
document.onkeydown = handleKeyDown;
}
//-->
</script>
<!-- End add - No copy MOD -->
Could someone put this into a hack for vb? Only for posts though,like in showthread.php.
<!-- Start add - No copy MOD -->
<script language="javascript"> <!--
var previous_key ;
function clickIE4(){
if (event.button==2){
alert('No Right Click Is Allowed');
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert('No Right Click Is Allowed');
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
function handleKeyDown()
{
if (previous_key==17 )
{
switch (window.event.keyCode)
{
case 45 :
case 46:
case 67:
case 88:
alert('Copy Is Not Allowed');
event.keyCode=0;
previous_key=window.event.keyCode;
event.returnValue=false;
break;
}
} else if (previous_key==16)
{
switch (window.event.keyCode)
{
case 45 :
case 46:
alert('Copy Is Not Allowed'+window.event.keyCode);
event.keyCode=0;
previous_key=window.event.keyCode;
event.returnValue=false;
break;
}
}
previous_key=window.event.keyCode;
}
function handleKeyUp()
{
previous_key=0;
}
if ( 1 )
{
document.oncontextmenu=new Function("alert('No Right Click Is Allowed');return false")
document.onkeyup = handleKeyUp;
document.onkeydown = handleKeyDown;
}
//-->
</script>
<!-- End add - No copy MOD -->
Could someone put this into a hack for vb? Only for posts though,like in showthread.php.