vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Disable right click on your forum. (https://vborg.vbsupport.ru/showthread.php?t=237481)

borbole 03-03-2010 10:00 PM

Disable right click on your forum.
 
1 Attachment(s)
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.

RedHacker 03-04-2010 05:15 PM

This disable and the "CODE" "/CODE" .....?

borbole 03-04-2010 05:27 PM

Quote:

Originally Posted by RedHacker (Post 1997124)
This disable and the "CODE" "/CODE" .....?

I am not sure what you are asking. This will disable the ability to use the right click at your forum for all the guests.

whitedd 03-04-2010 11:28 PM

...what about ctrl+c???...

borbole 03-05-2010 09:21 AM

Quote:

Originally Posted by whitedd (Post 1997389)
...what about ctrl+c???...

This disables only the right click.

Quote:

Originally Posted by Dr.osamA (Post 1997379)
thanxxx

installed

not working with Opera but with ff it is ok

plzz lok for CODE working with IE Opera & FF

I will look into it.

TimberFloorAu 03-05-2010 09:27 AM

Why bother ?

When the context menu has been disabled like this it can be easily re-enabled by typing javascript:void oncontextmenu(null) into the address bar of the browser.

View source code in nearly every browser.

Opera ignores no right clicks anyhoo.

All you will do is piss people off

borbole 03-05-2010 11:37 AM

You got a point TimberFloorAu. There is no 100% of preventing that but we might as well try to make them work harder :D

TimberFloorAu 03-05-2010 11:07 PM

LOL

You should do the javascript version. When they right click they get a warning, if they do it again : it will redirect them to a porn site !

Markos 03-07-2010 03:14 PM

how do i set it so no one can do it ?? for certain user groups

borbole 03-07-2010 04:07 PM

Quote:

Originally Posted by Markos (Post 1999160)
how do i set it so no one can do it ?? for certain user groups

Replace the code with this one:

Code:

<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">
<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>


And change the gids 1,2,3 with your own usergroups ids that you don''t want to use the right click function at your forum.


All times are GMT. The time now is 07:21 PM.

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.01259 seconds
  • Memory Usage 1,740KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete