Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Disable right click on your forum. Details »»
Disable right click on your forum.
Version: 1.00, by borbole borbole is offline
Developer Last Online: Oct 2015 Show Printable Version Email this Page

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.
2 благодарности(ей) от:
misericorde

Comments
  #32  
Old 06-22-2011, 10:57 AM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Regards,
Doug
Attached Images
File Type: png Screen shot 2011-06-22 at 7.53.04 AM.png (464.8 KB, 0 views)
Reply With Quote
  #33  
Old 01-30-2012, 08:35 PM
apaydin2148 apaydin2148 is offline
 
Join Date: May 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
2 благодарности(ей) от:
alhidaya, AURFSCAN
  #34  
Old 02-04-2012, 10:15 AM
lapiervb lapiervb is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can it disable right click for the members also?
Reply With Quote
  #35  
Old 06-05-2012, 03:46 PM
shiraz sat shiraz sat is offline
 
Join Date: Jun 2009
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by apaydin2148 View Post
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>
Hello
This script can also be used for other user groups?
Please Help
Reply With Quote
  #36  
Old 07-11-2012, 08:45 AM
30022 30022 is offline
 
Join Date: Apr 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works but in Chrome the scrollbars dont work, so if you dont have a mouse wheel you can't scroll down to read the full content.

I'm using both the right click disable & the disable copy text, not sure which one or both causes this to happen.
Reply With Quote
  #37  
Old 07-11-2012, 07:40 PM
davidg davidg is offline
 
Join Date: Apr 2010
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TimberFloorAu View Post
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 !
briliant idea lol
if u can make it please share it with us
Reply With Quote
  #38  
Old 10-07-2012, 06:04 PM
faisaly.com faisaly.com is offline
 
Join Date: Mar 2007
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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 !
why give them that kind of enjoyment, why not send them to a different site!
Reply With Quote
  #39  
Old 03-04-2013, 10:01 AM
wildheart's Avatar
wildheart wildheart is offline
 
Join Date: Jul 2011
Location: South Africa
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you so much for this. I have included all 3 although only the 'prevent highlight' should do the job alone.
Reply With Quote
  #40  
Old 03-14-2013, 01:44 PM
wildheart's Avatar
wildheart wildheart is offline
 
Join Date: Jul 2011
Location: South Africa
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by apaydin2148 View Post
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.
Reply With Quote
  #41  
Old 03-29-2013, 03:07 PM
JordanBuss13 JordanBuss13 is offline
 
Join Date: Nov 2012
Location: Saint.Neots UK
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do you make it so no one can right click even if there signed in?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:00 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.05881 seconds
  • Memory Usage 2,351KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (3)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete