Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2015, 09:54 PM
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 04-16-2015, 10:22 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<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>
Reply With Quote
  #3  
Old 04-16-2015, 11:14 PM
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 04-16-2015, 11:59 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

talk to ozzy on his site see if he will add in what option you need
Reply With Quote
  #5  
Old 04-17-2015, 01:00 AM
Elite_360_'s Avatar
Elite_360_ Elite_360_ is offline
 
Join Date: Nov 2012
Location: New Hampshire
Posts: 518
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Благодарность от:
ForceHSS
  #6  
Old 04-17-2015, 02:15 AM
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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." ?
Reply With Quote
  #7  
Old 04-17-2015, 11:47 AM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't in the above it you need to be rewritten
Reply With Quote
  #8  
Old 04-17-2015, 02:53 PM
Elite_360_'s Avatar
Elite_360_ Elite_360_ is offline
 
Join Date: Nov 2012
Location: New Hampshire
Posts: 518
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MacroPhotoPro View Post
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.
Reply With Quote
2 благодарности(ей) от:
Donavaz, MarkFL
  #9  
Old 04-17-2015, 03:25 PM
MacroPhotoPro MacroPhotoPro is offline
 
Join Date: Feb 2012
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 04-18-2015, 08:40 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You realize that if the user is viewing the image using a browser, the image is already downloaded to their computer, right?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10825 seconds
  • Memory Usage 2,262KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete