Code to stop Vistor from copy in my fourm

Code to stop Vistor from copy in my fourm

for you information also i use ChatGPT to help me but block all user from copy

maybe it's need some update if anyone can help

Step 1: Add Custom CSS for Non-Logged-in Users
To block text selection and right-click only for non-logged-in visitors, you'll need to wrap the CSS in a conditional class that is applied to guest users.

  1. Go to Admin Control Panel > Appearance > Style Properties > Extra.less (or wherever you add custom CSS).
  2. Add the following code to block text selection for guests:
Code:
You must log in to view
(16 lines)

This CSS uses the :not(.xfUserIsLoggedIn) selector to apply the styles only to users who are not logged in (i.e., guests). The .xfUserIsLoggedIn class is automatically added by XenForo when a user is logged in.

Step 2: Add Custom JavaScript to Disable Right-click for Guests​

Next, you need to add JavaScript that will disable the right-click context menu for non-logged-in users. The same idea applies: check if the user is a guest and then apply the JavaScript.

  1. Go to Admin Control Panel > Appearance > Templates.
  2. Open the PAGE_CONTAINER template.
  3. Scroll to the bottom (just before the closing </body> tag) and add this JavaScript code:
Code:
You must log in to view
(9 lines)
 
Good day support,

befor i was use the below code to stop copy in my fourm, after update new version of xenforo code not working any more.

Code:
You must log in to view
(1 lines)

can i find new code compatible with xenfor new version 2.3 to stop wright click copy and keyboard copy also?


I use this add-on for 2.3.4

[mongkolwa] Copy Protection 1.0.0​

 
Similar threads Most view View more
Back
Top Bottom