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?


All times are GMT. The time now is 06:59 AM.

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.01129 seconds
  • Memory Usage 1,738KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete