PDA

View Full Version : Miscellaneous Hacks - Disable Right Click


Shadow
13 Oct 2012, 16:33
This script will act as a sort of barrier to prevent people from right clicking on your forum thus offering some sort of protection. There are ways to get round this but think of it as a hurdle which may put some people off.

Add the following code to the header template:
<script type="text/javascript">
<!--
var error="Right click functionality is disabled";

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(error);return false")

// -->
</script>

While this blocks the ability to Right Click, it also blocks the ability to copy and paste through the context menu that appears when Right Clicking. Copy and paste functionality is still available through the Ctrl+C and Ctrl+V shortcuts respectively.

Editing the Error Message:
Changing the message shown is a piece of cake. This can be done by finding this line near the top of the script:

var error="Right click functionality is disabled";

Change the text in quotes to anything you like.

TheSupportForum
13 Oct 2012, 21:46
Suggestion :

1) Create Template with this code
2) create a hook : in Header_head
Template Name : from template 1


then there is no need to edit the template

with VB5 alot of use will be aiming towards using template hooks to do all the tasks for use

Shadow
14 Oct 2012, 10:58
Good suggestion. Thanks for the tip :)

Asterix_ita
16 Oct 2012, 15:16
now you can create a mod :p

Shadow
16 Oct 2012, 17:52
Added an xml file that will automatically add the template changes. You can also edit the error message from the Settings page instead of through the template when using the xml file.

Nirjonadda
16 Oct 2012, 18:48
Have an update for 4.1.10 ?

TheSupportForum
16 Oct 2012, 20:14
Have an update for 4.1.10 ?

this is for VB5 only, you need to request a VB4 version

in this case you would be asking the developer to downgrade the mod

VB5 uses a completly new hook system and will not work on VB4

JamalFree
05 Jan 2013, 18:35
:up: thanks iwill applied in my forums

Dorgham
31 Mar 2013, 01:38
Lock the right button of the mouse has some advantages:
Such as lack of access to the source of the page
And do not copy the content of Thread
And do not copy URL
Thanks :)

Keythacker
31 Mar 2013, 06:24
May seem like a stupid question but this "hook" your talking about how does one go about doing that? I know how to create the template but the hook is something I am not familiar with. Will be glad to read some if I need to learn.

MajorKokosnuss
01 Jun 2014, 07:27
how can i disable this block for admins ?

ForceHSS
01 Jun 2014, 07:53
how can i disable this block for admins ?

http://www.vbulletin.org/forum/showthread.php?t=310210
This plugin is better

MajorKokosnuss
01 Jun 2014, 08:57
i need one for v 5.1.1

ForceHSS
01 Jun 2014, 10:20
Did not see this was vb5 section

AusPhotography
01 Jun 2014, 10:30
We are a photography forum.
We don't implement anti-right click.
Why? Its just too easy to circumvent and it only keeps honest people away.

You are better off making attachments not visible to guests/not logged in than doing this.

Just sayin, it gives people a very false sense of security

Spangle
01 Jun 2014, 18:14
Great little fix for anyone with their own photo's on a site, and the fact the message is customisable is great too.

AusPhotography
02 Jun 2014, 04:54
Great little fix for anyone with their own photo's on a site, and the fact the message is customisable is great too.

Read my post above.

The problem is that this mod gives a very very very false sense of security.
And this comment brought to you by a photography who runs a photography forum - go figure!

:D

Spangle
02 Jun 2014, 18:27
Read my post above.

The problem is that this mod gives a very very very false sense of security.
And this comment brought to you by a photography who runs a photography forum - go figure!

:D


I did read your comment above, and yes I do know there are ways around it, but stopping a copy/paste will put off the casual plagiarism, they probably wont have the means to prnt scrn, import it into photoshop, just for a picture.

The hardened user will of course be able to.

The safest way is watermark all pictures before publishing them, which is what all the stock photo sites do. even then if you know your way around PS you can remove a watermark with a few clicks.

AusPhotography
04 Jun 2014, 03:49
I did read your comment above, and yes I do know there are ways around it, but stopping a copy/paste will put off the casual plagiarism, they probably wont have the means to prnt scrn, import it into photoshop, just for a picture.

The hardened user will of course be able to.

The safest way is watermark all pictures before publishing them, which is what all the stock photo sites do. even then if you know your way around PS you can remove a watermark with a few clicks.

a) You don't have to be hard core to do this; just disable JS in your browser while on the page and get the image direct via right click -- hence my false sense of security comment

Firefox: (it's this easy)

In the address bar, type "about:config" (with no quotes), and press Enter.
Click "I'll be careful, I promise"
In the search bar, search for "javascript.enabled" (with no quotes).
Right click the result named "javascript.enabled" and click "Toggle". JavaScript is now disabled.


b) I 100% agree that watermarking is your best defence other than not publishing

Merenguista
23 Oct 2014, 10:03
Suggestion :

1) Create Template with this code
2) create a hook : in Header_head
Template Name : from template 1


then there is no need to edit the template

with VB5 alot of use will be aiming towards using template hooks to do all the tasks for use

Can u please give us even more details so i can create a template and hook as a beginner ?

Ivan Beser
31 Oct 2014, 13:08
Can u please give us even more details so i can create a template and hook as a beginner ?

Perhaps this will help you:

http://www.vbulletin.com/forum/blogs/joe-d/3932614-
http://www.vbulletin.com/forum/blogs/wayne-luke/3929999-

Emad ELsayed
27 Mar 2018, 17:04
Unfortunately: the product does not work 5.4.0