VSD 6.0 Build 3 - Protecting pictures...

User 1892988 Photo


Registered User
151 posts

I'm not sure in which forum I have to post this question but here it goes:

How can I protect in VSD images for right-click > Save picture as...?

The protection this offers is very minimal but at least it's something.
HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 103173 Photo


VP of Software Development
0 posts

All you need to do is add a JavaScript into your header.

There are literally hundreds of these scripts out there. You can find some at http://www.google.com/search?client=fir … gle+Search
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
User 463058 Photo


Ambassador
1,085 posts
Online Now

There have been several threads on this so searching the forum should turn up something. However, as you mentioned the protection is basically nothing against those who actually want your images, but the level of irritation and inconvenience for typical visitors who like to use their context menu is very high.
User 1892988 Photo


Registered User
151 posts

@ Scott:
You're right Scott, I had to Google it first. Found it and it works. Thanks!

@ Cary:
I actually do a search 9 out of the 10 times but I guess I was looking for a quick answer.:D Scott make it clear to me that it's a lot faster if I did the search in the first place.

HA! :cool:
HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 582635 Photo


Registered User
16 posts

<!-- Start of Protect Code Script -->
<!-- Instructions: Place this code inside the body tags. -->
<script language="JavaScript">

<!--
function mouseDown(e) {
if (parseInt(navigator.appVersion)>3) {
var clickType=1;
if (navigator.appName=="Netscape") clickType=e.which;
else clickType=event.button;
if (clickType!=1) {
alert("Copyright (c) 2009 Tommy Wheeler All the images contained within are intellectual property. Do not attempt to copy them without written permission.");
}
}
return true;
}
if (parseInt(navigator.appVersion)>3) {
document.onmousedown = mouseDown;
if (navigator.appName=="Netscape")
document.captureEvents(Event.MOUSEDOWN);
}
//-->

</script>
User 1892988 Photo


Registered User
151 posts

Thanks Tommy!

I Googled a solution already and it work just fine in IE and FF.

I might that your script can help others.

Hereunder the scripts I currently use:

HEADER script:

<script language="JavaScript">
<!--
/*
No rightclick script v.2.5
(c) 1998 barts1000
barts1000@aol.com
Don't delete this header!
*/

var message="Sorry, that function is disabled.\nThis Page Copyrighted and\nImages and Text protected!\nALL RIGHTS RESERVED";

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->

</script>


BODY script:

<body oncontextmenu="return false;">
<body ondragstart="return false" onselectstart="return false">
<body style="user-select: none; -khtml-user-select: none; -moz-user-select: none;">

HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 463058 Photo


Ambassador
1,085 posts
Online Now

Since pages only have one body tag, which one of those three did you end up using?
User 1892988 Photo


Registered User
151 posts

Their might be a difference between:

<body>
....
<,/body>


and

<body ...="...">


is that what you mean?

It's looks about like this:

<body>
<body oncontextmenu="return false;">
<body ondragstart="return false" onselectstart="return false">
<body style="user-select: none; -khtml-user-select: none; -moz-user-select: none;">
,,,
...
</body>

HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 463058 Photo


Ambassador
1,085 posts
Online Now

Wow! That's four body tags! Since you should only have one, try this code instead. It's all in one body tag.

<body oncontextmenu="return false;" ondragstart="return false" onselectstart="return false" style="user-select: none; -khtml-user-select: none; -moz-user-select: none;">
User 1892988 Photo


Registered User
151 posts

Oh...that's what you mean!

Yes, your 100% right and I'm aware of that.

Thanks for pointing this out.

HTML allow me to do this and I'm glad it does. It makes the the source more readable.

I try to create a "snippet" library and benefit a lot from readability. (I'm still a green you know :cool:)

For instance, instead of this:
<body><img style="Z-INDEX: 100; POSITION: absolute" border="0" alt="" src="file://C:/Documents and Settings/Dick/Desktop/MM-CobraEarWrap_LRG.jpg" width="300" height="450">

</body>


I really love this:

<body>
<img style="Z-INDEX: 100;
POSITION: absolute"
border="0"
alt=""
src="file://C:/Documents and Settings/Dick/Desktop/MM-CobraEarWrap_LRG.jpg"
width="300"
height="450">
</body>


Forgive me for I don't know any better after too many years of programming.
HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.