1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you want premium products then purchase our VIP or SVIP plans
  3. Dont forget read our rules HERE Also anyone caught Leeching this content or Scamming will be banned on numerous networks.
    Dismiss Notice
  4. Dont forget we do not allow Multiple Accounts, so all of your accounts as well as your IP will be banned.
    Dismiss Notice
  5. Tired of Download Limits ? UPGRADE Today!
    Dismiss Notice

FREE Disable Right Click

Discussion in 'vBulletin Template Mods & Extras' started by HAWK, Mar 23, 2016.

  1. HAWK

    HAWK Administrator Staff Member ADMIN

    Likes Received:
    Trophy Points:
    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){
    return false;

    function clickNS4(e){
    if (document.layers||document.getElementById&&!document.all){
    if (e.which==2||e.which==3){
    return false;

    if (document.layers){
    else if (document.all&&!document.getElementById){

    document.oncontextmenu=new Function("alert(error);return false")

    // -->

    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.

Share This Page

Post thread