We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

help to keep casual users from copying your text | Forum

dave Leader
dave Oct 18 '13

First this is not perfect solution, nothing is.  There are tons of easy ways around this, which i wont mention here but those that know how to can easily get by this method. 

 

This is just something i thought i would share.   The topic was brought up on one of the coding forums i belong to and after a few days of discussion about the pro's and con's of doing something like this, this was the lessor of all evils.

 

The challenge is to try to keep the "casual" user from stealing your text on your page after you spent tons of time writing it.  

 

There are numerious methods including shutting down JS all together, turning off features on the page, restricting features and much more.  But in the end  there is nothing 100% that will stop those what want your text to have it.   Most of the most popular methods end up in the end upsetting the good users on your site that will never take anything. 

 

And short of doing a screen print of  your text document with the watermark in the background and posting an image to the page showing the story rather than text, this is the lessor of all evils to at least slow down the casual user.

 

The reason i like this is because it limits the restriction to one part (the text part) rather than the whole page which is nice. 

 

So far i have only done the forum section, i have not done anything else, but here is the general idea and what i did with the forum text.

 

open ow_plugins/forum/views/controllers/topic_index.html

 

find this section (about line 105)

 

<div class="post_content">{$post.text}</div>

 

that $post.text is what holds the text for this topic so what we will do is restrict the options on that text only. 

 

here is how

 

The new code looks like this

 

<div class="post_content">

 

<!-- added by dave to stop right click on text so no copy paste -->
 <div oncontextmenu="javascript:alert('We worked hard on this text - please do not copy it - that is so wrong!');return false;">{$post.text}</div>
<!-- end add  -->

 

</div>

 

 

 

all i did was i took this part  {$post.text}  and i wrapped it with a new div. Leave everything else alone around it.

 

now save and refresh your cache.

 

The result is that when they try to right click on the text it will show that message and wont let them.  Of course you can change the message.  The point here is to try to appeal to their sense of decency and remind them kindly that it is stealing.

 

enjoy

 

ps i hope that oxwall or some dev comes up with a plugin or something to assist in this, there are enough tricks out there, maybe some of them should be included as an option out of the box, especially for forums, groups, and other text rooted features that can be stolen from.

 

UPDATE:  just tested a group text and its the same affect so it looks like this one change to this file will take care of the text for both forum and group text (assuming you have your groups attached to your forum in group plugin options)

 

 

The Forum post is edited by dave Oct 18 '13
Kieron H Leader
Kieron H Oct 19 '13
thanks dave this is very useful 
Christer
Christer Oct 19 '13
great one dave, thanks
dave Leader
dave Oct 21 '13
your very welcome, maybe this can be a sticky ;)