XenForo Protect your content easy way (Do Not Copy)

CR LEAKS

Administrators
Joined
Mar 25, 2022
Messages
1,485
Credits
28,051
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 :
View attachment 27
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
 
Back
Top Bottom