Yes, I know it's not a perfect solution, but my client wants to disable right click and image download for Node Gallery. Does anyone have the code, and where does it go?

Thanks

Comments

dbeall’s picture

This is not the answer you were looking for..
Maybe water mark the images, because anyone can still get the image, even with right click disabled. The rule is, if you can view it, you can save it.
Sometimes I have to use the FF developer tool bar 'view image information' for lightbox images, or screen capture for flash images.

This code will work in 'some' but not 'all' cases...

<script type="text/javascript">
    $(document).ready(function(){
      $("img").bind("contextmenu",function(e){
        return false;
      });
    });
  </script>
hassansr’s picture

i have considered watermarks, however the client is adamant on the non download issue. So i need to be able to disable right click

dbeall’s picture

This one is better
http://www.dynamicdrive.com/dynamicindex9/noright.htm

Edit: this would have to go in the page.tpl.php file in your theme folder below the body tag.

hassansr’s picture

that works really well, thanks

summarize:

1. add this to page.tpl.php in the theme being used inside the body tags | it will be identified by something like, div id="body_left" or div id="body_right" or div id="body"|

copy from here>>

2. need to make sure to remove it and refresh before editing pages or life will be irritating for editor.
3. replace and save when done

the path to files is still available via view source and the copy using ctrl-c still works, but for most users it should stop them from downloading images

dbeall’s picture

Title: any idea how to disable the right cclck to download images » How to disable the right click to prevent downloading images
Component: Code » Miscellaneous
Category: feature » support

@hassansr, glad that is working for you.
Change title for search results, category, component and close this one as it looks to be solved..

dbeall’s picture

Status: Active » Closed (fixed)
Sandip Choudhury’s picture

Copy Prevention is a module - https://drupal.org/project/copyprevention for -
Disable text selection
Disable copy to clipboard
Disable right-click context menu on all site content
Disable right-click context menu only on images
And for disable many more . . .