PDA

View Full Version : Code for "No Right Click" on Forums


MacroPhotoPro
04-16-2015, 09:54 PM
Hi;

I am running an image-hosting forum and would be interested in a hack that I could protect images displayed on showthread.php (forum display thread default) from a right-click save. The following javascripting isn't working:

$("#vfIMG_main_pic").bind("mousedown", MainPicMouseDown);
$("#slideshow_pic").bind("mousedown", MainPicMouseDown);

function MainPicMouseDown(event) {
switch(event.which) {
case 3:
alert("This image is protected by legal copyright and is the property of its owner.");
break;
default:
// do nothing
}
}

What code would you recommend to disable right-clicking and display the message: This image is protected by legal copyright and is the property of its owner ?

Would be grateful for any input,

Jack

ForceHSS
04-16-2015, 10:22 PM
<a href="http://ozzmodz.com/showthread.php/7021-OzzModz-Disable-Right-Click-%28vB4%29-%28vB3-8%29-v1-0-1" target="_blank">http://ozzmodz.com/showthread.php/70...B3-8%29-v1-0-1</a>

MacroPhotoPro
04-16-2015, 11:14 PM
Thank you. It works perfectly for the photos ... unfortunately, it also disables right-clicking on TEXT too in the Edt text section :(

--------------- Added 1429233278 at 1429233278 ---------------

Any other ideas?

ForceHSS
04-16-2015, 11:59 PM
talk to ozzy on his site see if he will add in what option you need

Elite_360_
04-17-2015, 01:00 AM
Add this at the end of your footer Template.



<script>

document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
return false

}

</script>


Found it at DynamicDrive.com (http://www.dynamicdrive.com/dynamicindex9/noright2.htm)

MacroPhotoPro
04-17-2015, 02:15 AM
I appreciate this, thank you ... where can I place the following verbiage:

"This image is protected by legal copyright and is the property of its owner." ?

ForceHSS
04-17-2015, 11:47 AM
You can't in the above it you need to be rewritten

Elite_360_
04-17-2015, 02:53 PM
I appreciate this, thank you ... where can I place the following verbiage:

"This image is protected by legal copyright and is the property of its owner." ?

Try this



<script>

document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
alert('This image is protected by legal copyright and is the property of its owner');

}

</script>



The code above might stop a normal user from stealing your images but you can always steal an image by inspect element in your browsers.

MacroPhotoPro
04-17-2015, 03:25 PM
Thank you very much!

If you can't right-click, how do you employ inspect element?

--------------- Added 1429291728 at 1429291728 ---------------

This works perfectly, thank you.

--------------- Added 1429291840 at 1429291840 ---------------

BTW, I see what you're saying on the inspect element. But at least it's a cursory deterrent. Thanks again.

--------------- Added 1429301092 at 1429301092 ---------------

Actually, there is a problem.

I get the "No right click" message ... however, when I click-away the error message, then my right-click menu pops up, so I can do the same thing anyway :(

How do I get rid of that second-appearance of my full right-click menu?

Thanks again,

Jack

Lynne
04-18-2015, 08:40 PM
You realize that if the user is viewing the image using a browser, the image is already downloaded to their computer, right?

MacroPhotoPro
04-18-2015, 09:17 PM
Yes, I realize that (ultimately) no deterrent can stop someone who really knows what they're doing.

However, no-right-click does deter the lion's share of people trying for free downloads.

It's kind of like locking your home/car. Do you realize that, if someone is hell-bound intent on getting into your car, or home, they can?

But you still lock your car and your home, right? :)

In the same way, employing a no-right-click is still a good idea for an image-hosing forum, as it prevents most people from trying.

Thanks and, btw, do you have a solution? :)

Jack

alcazarx
04-19-2015, 10:14 AM
Do you realize that you should use a better tone against an administrative member? :rolleyes:

Also, if you deactivate JS in your Browser, many of these "scripts" wont work.
Besides, you can also use screenshots/snapshots to get images.

Solution? If you dont want them to be seen on other pages you can using .htaccess to prevent hot linking or watermark them.
Best solution is, if you dont want images to be shared or loaded, dont post them on internet (but this you probably dont want to hear :p )

Zachery
04-19-2015, 11:49 AM
I stop using websites that prevent me from right clicking.

Elite_360_
04-19-2015, 01:23 PM
<script>

document.oncontextmenu = function(e)
{
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
{
alert('This image is protected by legal copyright and is the property of its owner');
return false;
}

}

</script>

MacroPhotoPro
04-19-2015, 02:21 PM
<script>

document.oncontextmenu = function(e)
{
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
{
alert('This image is protected by legal copyright and is the property of its owner');
return false;
}

}

</script>


Thank you very much for your time. Sincerely appreciated.

Jack

thetechgenius
04-20-2015, 11:33 PM
You should know, a lot of people find this very annoying on websites.

Also when you load a web page, all the images get downloaded on your PC, to a Cache or Temp directory. All you need to do is, in FireFox click the sites Favicon, go to More Information, then click on the Media Tab and all the forum images are right there for you to download. All the images that are loaded anyway.