vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Code for "No Right Click" on Forums (https://vborg.vbsupport.ru/showthread.php?t=318274)

MacroPhotoPro 04-16-2015 09:54 PM

Code for "No Right Click" on Forums
 
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:

Code:

$("#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 [DATE]1429233278[/DATE] at [TIME]1429233278[/TIME] ---------------

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.

Code:


<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

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

Quote:

Originally Posted by MacroPhotoPro (Post 2543302)
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

Code:


<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 [DATE]1429291728[/DATE] at [TIME]1429291728[/TIME] ---------------

This works perfectly, thank you.

--------------- Added [DATE]1429291840[/DATE] at [TIME]1429291840[/TIME] ---------------

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

--------------- Added [DATE]1429301092[/DATE] at [TIME]1429301092[/TIME] ---------------

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

Code:


<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

Quote:

Originally Posted by Elite_360_ (Post 2543517)
Code:


<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.


All times are GMT. The time now is 05:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01770 seconds
  • Memory Usage 1,759KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete