vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=259)
-   -   Miscellaneous Hacks - Disable Right Click (https://vborg.vbsupport.ru/showthread.php?t=289020)

Shadow 10-12-2012 10:00 PM

Disable Right Click
 
1 Attachment(s)
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:
Code:

<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:

Code:

var error="Right click functionality is disabled";
Change the text in quotes to anything you like.

TheSupportForum 10-13-2012 07:46 PM

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 10-14-2012 08:58 AM

Good suggestion. Thanks for the tip :)

Asterix_ita 10-16-2012 01:16 PM

now you can create a mod :p

Shadow 10-16-2012 03:52 PM

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 10-16-2012 04:48 PM

Have an update for 4.1.10 ?

TheSupportForum 10-16-2012 06:14 PM

Quote:

Originally Posted by Nirjonadda (Post 2373496)
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 01-05-2013 05:35 PM

:up: thanks iwill applied in my forums

Dorgham 03-31-2013 12:38 AM

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 03-31-2013 04:24 AM

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 06-01-2014 05:27 AM

how can i disable this block for admins ?

ForceHSS 06-01-2014 05:53 AM

Quote:

Originally Posted by MajorKokosnuss (Post 2500298)
how can i disable this block for admins ?

https://vborg.vbsupport.ru/showthread.php?t=310210
This plugin is better

MajorKokosnuss 06-01-2014 06:57 AM

i need one for v 5.1.1

ForceHSS 06-01-2014 08:20 AM

Did not see this was vb5 section

AusPhotography 06-01-2014 08:30 AM

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 06-01-2014 04:14 PM

Great little fix for anyone with their own photo's on a site, and the fact the message is customisable is great too.

AusPhotography 06-02-2014 02:54 AM

Quote:

Originally Posted by Spangle (Post 2500355)
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 06-02-2014 04:27 PM

Quote:

Originally Posted by AusPhotography (Post 2500391)
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 06-04-2014 01:49 AM

Quote:

Originally Posted by Spangle (Post 2500456)
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

Quote:

Firefox: (it's this easy)
  1. In the address bar, type "about:config" (with no quotes), and press Enter.
  2. Click "I'll be careful, I promise"
  3. In the search bar, search for "javascript.enabled" (with no quotes).
  4. 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 10-23-2014 08:03 AM

Quote:

Originally Posted by TheSupportForum (Post 2372783)
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 10-31-2014 11:08 AM

Quote:

Originally Posted by Merenguista (Post 2519832)
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...-luke/3929999-

Emad ELsayed 03-27-2018 02:04 PM

Unfortunately: the product does not work 5.4.0

Artes_Marciales 02-14-2020 06:22 AM

Nice mod,
this Work in 5.5?

Mboora 12-31-2020 09:41 PM

Please could someone update this for 5.6.4?


All times are GMT. The time now is 06:18 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01133 seconds
  • Memory Usage 1,764KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete