News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How can I prevent select-copy action?

Started by avyaban, March 27, 2011, 09:27:05 AM

Previous topic - Next topic

avyaban

Hi everyone;

How can I prevent select-copy action of the text and images from the topics by the visitors in my forum ?

My version SMF 2.0 RC3

Thanks in advance..

Arantor

Long story short: you can't. There's no method you can use that's actually reliable and that can't be disabled in a matter of clicks on any modern/capable browser - and even then, most of the time it won't solve anything.

avyaban

Isn't there any way ?

Quote from: Arantor on March 27, 2011, 09:33:26 AM
Long story short: you can't. There's no method you can use that's actually reliable and that can't be disabled in a matter of clicks on any modern/capable browser - and even then, most of the time it won't solve anything.

Spale

Try to disable Copy and Paste using this JavaScript :

<!-- Disable Copy and Paste-->
<script language='JavaScript1.2'>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function (&quot;return false&quot;)
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>


Insert the code between the <head> and </head> tag of your forum.
"Failure is only the opportunity to begin again more intelligently." - Henry Ford

Arantor

-sigh-

Yes, there are methods that prevent select/copy. Except that none of them are remotely reliable and can be defeated in a matter of seconds in most browsers without any real work at all, and that it's likely to break other things if you do attempt to use such methods.


@Spale: Which is great until a user doesn't use Javascript, uses a browser that doesn't like that syntax (the code is invalid Javascript, by the way), or that the user is smart enough to just view the source anyway to get the content they want. I'd note that search engines and page scrapers aren't affected either.

Oh, and users like me who open things in new tabs are also inconvenienced.

HunterP

Quote from: avyaban on March 27, 2011, 09:36:34 AM
Isn't there any way ?

Yes there are ways, but if someone is determined to copy something, he will succeed because there are allways ways to by-pass all those kind of protections, like a print-screen, viewing the page source of plugings which can show only the source of selected objects like images.

I understand your concerns, but IMHO you shouldn't put too much effort in this issue.

Spale

Quote from: HunterP on March 27, 2011, 09:53:17 AM
But if someone is determined to copy something, he will succeed because there are allways ways to by-pass all those kind of protections, like a print-screen, viewing the page source of plugings which can show only the source of selected objects like images.

I completely agree with above... You cannot stop somebody to copy your content, if he is determined to do so.
There is always a way to bypass all protections.
"Failure is only the opportunity to begin again more intelligently." - Henry Ford

avyaban

Thank you very much..

Which file (php or something) will I insert this code into ?


Quote from: Spale on March 27, 2011, 09:40:44 AM
Try to disable Copy and Paste using this JavaScript :

<!-- Disable Copy and Paste-->
<script language='JavaScript1.2'>
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function (&quot;return false&quot;)
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>


Insert the code between the <head> and </head> tag of your forum.

Arantor

Well, it would be your theme's index.template.php but I wouldn't bother since it'll break anything that uses Javascript on your page, which includes certain things SMF does out of the box like the quick edit, quick quote and a few other things.

Roph

If you don't want people to be able to copy things from your site, there is only one solution to completely prevent it: Don't put that stuff on your site.

To put it another way: If you don't want them to take it, don't give it to them!

Spale

One more solution could be to put a protection banner to your forum: http://copyscape.com/banners.php?o=f

You can try to defend your site with a plagiarism warning banner to warn potential plagiarists against stealing your content.

You can use this add-on to add the banner to your forum: Global Headers and Footers
"Failure is only the opportunity to begin again more intelligently." - Henry Ford

Advertisement: