[For 1.8] How to disable right clicking
#1
Go to your ACP -> Templates & Styles -> Templates -> The theme name you want to add this to -> Index Page Templates -> index

Now add the following code above </head>:
<script language="javascript"> 
    document.onmousedown=disableclick;
    status="Sorry my theme is to be paid for and not ripped! Please try again another time! Good Bye!";
    function disableclick(event)
    {
      if(event.button==2)
       {
         alert(status);
         return false;    
       }
    }
    </script>

Change the status to whatever you want it to say now find the <body> tag and replace it with the following:
<body oncontextmenu='return false'>

Enjoy & Happy Coding!
Technologx Support Forum
Check out UPicMe there you can upload and share your pics!
Please give me a + If I've helped.
Reply
#2
Use this, far much better: Disable right click, cut and copy text
jQuery(document).bind("contextmenu cut copy",function(e){
    e.preventDefault();
    alert('Copying is not allowed');
});

btwys, such things are not good from SEO point of view
Reply
#3
I just don't like things I worked hard on to be stolen and put up for free.
Technologx Support Forum
Check out UPicMe there you can upload and share your pics!
Please give me a + If I've helped.
Reply
#4
Disabling right click is generally a bad idea. It won't stop people downloading content, but it will prevent everyone with Javascript enabled from using the context menu which is quite annoying, and if you're showing an alert message every time someone right clicks on the page, you're going to lose visitors.

It's a bad solution to "how browsers work".
No longer involved in the MyBB project.
Reply
#5
(2016-04-26, 07:26 AM)Nathan Malcolm Wrote: Disabling right click is generally a bad idea. It won't stop people downloading content, but it will prevent everyone with Javascript enabled from using the context menu which is quite annoying, and if you're showing an alert message every time someone right clicks on the page, you're going to lose visitors.

It's a bad solution to "how browsers work".

I totally agree with this: 
Quote:if you're showing an alert message every time someone right clicks on the page, you're going to lose visitors.
Reply
#6
Hey no one has to use it it's just a tutorial
Technologx Support Forum
Check out UPicMe there you can upload and share your pics!
Please give me a + If I've helped.
Reply
#7
Works like a charm, thanks.
Reply
#8
You know there are many ways to bypass this? Such as CTRL + U will show you the source code. Just saying.
Reply
#9
Hey man no one said it had to be used it's just a way of doing something
Technologx Support Forum
Check out UPicMe there you can upload and share your pics!
Please give me a + If I've helped.
Reply
#10
Client-side security is bad. There are 3 ways I could bypass that type of security:

1) Disable Javascript on your site (refer to your web browser's documentation)
2) In Google Chrome type: view-source:site url here sees source code
3) Use curl or wget on Linux to download the page that way.

A better method would be to use source code obfuscation and inserting all CSS utilizing Javascript. Again it only secures you against basic users trying to rip the theme who don't understand what they're doing and are following simple tutorials.
Software Engineer specializing in C# Program Development
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)