XenForo Protect your content easy way (Do Not Copy)

alodda

Loyal Member
Registered
If you don't want original content from your site copied and used in other forums and sites, read on.
Even though there are plugins available, I will share with you a way to protect your content with a very simple code structure and no plugins.


Open ( your style ) PAGE_CONTAINER
! Add this codes mentioned at the bottom of our template !

JavaScript:
<script>
$(document).bind('copy', function(e){
alert('Oops!.. Copying Content From Our Site Is Forbidden !!!'); // Make alert for your visitors.
return false;
});
</script>

Result :
cr.md.png

Another Way
The safe way because java sometimes is crappy depending on the browser

JavaScript:
<script>
jQuery(document).bind("contextmenu", function(e) {
e.preventDefault()
alert('Oops!.. Copying Content From Our Site Is Forbidden !!!'); // Make alert for your visitors.
    return false;
});</script>

As usual if you want to allow admin to copy :)
add this code
HTML:
<xf:if is="$xf.visitor.isMemberOf(3)">
    <xf:else />
<script>
jQuery(document).bind("contextmenu", function(e) {
    e.preventDefault()
alert('Oops!.. Copying Content From Our Site Is Forbidden !!!');
    return false;
});</script>    </xf:if>


enjoy
 

DarKMaSK

Loyal Member
If you don't want original content from your site copied and used in other forums and sites, read on.
Even though there are plugins available, I will share with you a way to protect your content with a very simple code structure and no plugins.


Open ( your style ) PAGE_CONTAINER
! Add this codes mentioned at the bottom of our template !

JavaScript:
<script>
$(document).bind('copy', function(e){
alert('Oops!.. Copying Content From Our Site Is Forbidden !!!'); // Make alert for your visitors.
return false;
});
</script>

Result :
cr.md.png

Another Way
The safe way because java sometimes is crappy depending on the browser

JavaScript:
<script>
jQuery(document).bind("contextmenu", function(e) {
e.preventDefault()
alert('Oops!.. Copying Content From Our Site Is Forbidden !!!'); // Make alert for your visitors.
    return false;
});</script>

As usual if you want to allow admin to copy :)
add this code
HTML:
<xf:if is="$xf.visitor.isMemberOf(3)">
    <xf:else />
<script>
jQuery(document).bind("contextmenu", function(e) {
    e.preventDefault()
alert('Oops!.. Copying Content From Our Site Is Forbidden !!!');
    return false;
});</script>    </xf:if>


enjoy
Right click is not working, that's good. But ctrl+c / ctrl+p is working. Can it also be blocked?
 

XenForo

Administrative
This type can also be used
  • Add to the end of the template
  • page_container
JavaScript:
<script>
$(document).bind('copy', function(e){
      return false;
    });
</script>
<script>
$(document).bind('copy', function(e){
      alert('Oops . Copying Content From Our Site Is Forbidden');
      return false;
    });
</script>
 

alodda

Loyal Member
Registered
Another way for disable, right click & cut copy paste

Try this
JavaScript:
<script type="text/javascript">
$(document).ready(function () {

    //Disable mouse right click
    $("body").on("contextmenu",function(e){
        return false;
    });

    //Disable cut copy paste
    $('body').bind('cut copy paste', function (e) {
        e.preventDefault();
    });

});
</script>
 
Back
Top Bottom