HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Preventing users from copying text of images from website

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#103401 (In Topic #20243)
Avatar

Well-settled

How do I Prevent users from copying text or images from the website

I would like to lock down this from happening.


Robert W.
Back to the top
 
Posted
Rating:
#103402
Avatar

Well-settled

Chris,

I found you post on Disabling right-click, but I cannot seam to get it working.

Do I just add the code at the end of the file? or is there a place with in the file that I need to place it.

Also, how do I disable the Ctrl-C


Robert W
Back to the top
 
Posted
Rating:
#103474
Avatar

Well-settled

You might find these pages help:

http://www.dynamicdrive.com/dynamicindex9/noselect.htm

http://hypergurl.com/norightclick.html
(various snippets)

http://www.dynamicdrive.com/dynamicindex9/noright3.htm
(I use this one widely - eg. on pages, within document viewer code, etc. - I'd precede the opening <!-- with //  to comment it out. NB - the code doesn't disable content-selecting with the mouse, only right-clicks)

Of course, you try all of these at your own risk, but, to my knowledge, they're all trustworthy.

Cannot trace the code by Chris - please would you post the link to it?

Richard.




Back to the top
 
Posted
Rating:
#103478
Avatar

Well-settled

Thanks for imformation, I will try these out.

Heres the link:  Advanced configuration - ocPortal.com


Robert W
Back to the top
 
Posted
Item has a rating of 5 (Liked by RichT)  
Rating:
#103479
Avatar

Well-settled

RichT,

I tryed the first link you provided, it works great,

The Admin of the site still can select text (Left mouse Button) and can past Ctrl-v but other users cannot do that.

when you select an image and a popup window opens with that image, it still works, but when you select"See full image", it open a new window and it does not work in that URL shows it as "www…./data/attachment.php?id=##"


Robert W.
Back to the top
 
Posted
Rating:
#103480
Avatar

Well-settled

Hi Robert W!

Thanks for your comeback and link!

Glad to learn the first script does what you were wanting. I hadn't spotted either the exempted admin behaviour or the thumbnail target-image bit, both of which are great bonuses.

Good wishes,

Richard.
Back to the top
 
Posted
Rating:
#103491
Avatar

Well-settled

Spoke to soon...
I was using both Firefox and Chrome, I Chrome, it's locked but in Firefox it was not.
I gave my self a little time away form this problem and got back on this just a little while ago.

Tried doing it a few different ways until I got it working for both Right click menu, Left selecting and Ctrl C & V.
I it’s working now for both the users and the admin, except for when the admin goes into editing any of the pages, then it’s turned off.
In the Browser menu you can select All and then Copy, but I will not paste.

Again Rich. Thank you for the tip to the websites.
 
I still need to fix the Full image window.
 
Robert W.
Back to the top
 
Posted
Item has a rating of 5 (Liked by Jason VerhagenLiked by Jean)  
Rating:
#103492
Avatar

Well-settled

Heres how I done it

on the "GLOBAL_HTLM_WRAP.tpl


past this in as follows at line 13:

<script language=JavaScript>
<!--
 
//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com
 
var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
 
document.oncontextmenu=new Function("return false")
// -->
</script>
 
<script type="text/javascript">
 

 
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
                target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
                target.style.MozUserSelect="none"
else //All other route (ie: Opera)
                target.onmousedown=function(){return false}
target.style.cursor = "default"
}

 
And this at the end of the template (after the  </html>)

<script type="text/javascript">
disableSelection(document.body) //disable text selection on entire body of page
</script>



Robert W.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: