where do i put code to disable right click??

Where do I put code to disable right-click?

I just put some javascript code on my site to disable the right-click, and it works great.
(I know this is not going to stop someone who really wants to steal, but it should
cause those with a conscience to reconsider just copying it)

anyway it works great on my site code, but not when I link to my gallery in Zenphoto.

Does anyone know what module(s) or where I insert the code. (it needs to be between <head> and </head>

Thanks, George

Comments

  • 1) Please don't randomly email people directly. If we don't respond on the forum, then we don't respond on the forum.

    2) I'm going to provide some help in a minute, but first I'm going to jump on my soap box. What you are trying to do is a complete waste of time. All _anyone_ has to do is use the "View" menu to see the markup or your site. And there are a multitude of tools for completely downloading a website. Including the web browser itself. So when I come across a site that disables functionality of MY software, I leave it and never come back.

    3) Okay, here is where I actually provide some help to you. You have probably written some javascript that is incompatible with jQuery. Zen Photo uses the jQuery library and it is included on every page rendered by ZP. Off the top of my head, the following code is how I would (if I ever lost my mind) disable the right click action using jQuery:

    `
    jQuery(document).ready(function()
    {
    jQuery(this).click(function() {
    if (jQuery(this).event.button == 2) {
    event.preventDefault();
    return;
    }
    });
    });
    `
    That is totally untested and is not something I will help with further. Use Google if it doesn't work.
  • gfavchi Member
    Sorry I woke you up!! I will never do that again...

    Locking your doors does not keep thieves from breaking in your house...
    so why do we lock our doors?

    and thanks for the information.
  • There is no correlation between locking doors and breaking a user's software. HTML is not a protected document format. In other words, you should never expect to be able to keep someone from seeing your HTML or Javascript. In the case of Javascript, you can obscure the code so that it is extremely annoying to read (just look at any of Google's scripts). But you can't keep it hidden. Additionally, it is very simple to copy an image from the web browser; even if you can't "right click" the image. Simply take a screenshot of your browser and crop out the desired image. On a Mac it is even easier, you can select the region you want to copy.

    Would you like to know how easy it is to pull down _all_ resources necessary to have a local copy of a website? Using wget, `wget -pkr http://example.com/`. There, I've downloaded all images, HTML, Javascript, etc. to have a local copy of exmaple.com. And I can browse it just like I would by navigating to the real site.

    I understand that copyright on the web is difficult to keep track of. It is a valid concern. But breaking _my_ software because you think _I_ am a thief, well, that does not endear me to you or the information you want me to have.

    I use the context menu (right click menu) to navigate backward in my browsing history. It is much quicker than mousing to the top left corner of my web browser.
  • acrylian Administrator, Developer
    Although I don't use the context menu but the keyboard sometimes I absolutly second that. And just to add, a user has actually already downloaded the image to his browser's cache if he views it... It's kind of titling against windmills.
  • fsoly Member
    it is not work with me

    till me please where can i but it ??
    and how can i use it??

    thank you...
Sign In or Register to comment.