0
Welcome Guest! Login
0 items Join Now

Disabling right-click on a site..

    • Brett Youlten's Avatar

    Disabling right-click on a site..

    Posted 17 years 9 months ago
    • Hi, i was just wondering how i would go about disabling right-click on my site?..so that you dont have access to saving pictures and stuff ..i searched but didnt manage to come up with anything

      cheers.Brett
  • Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • ============================================================
      Script:    Basic No-Right-Click Script
      Functions: Blocks right-click on mouse and shows alert box
      Browsers:  NS & IE 4.0 & later; degrades gracefully
      Author:    etLux
      ============================================================
       
      Put the following script in the head of your page:
       
      <script language="Javascript1.2">
       
      // (C) 2003 CodeLifter.com
      // Source: CodeLifter.com
      // Do not remove this header
       
      // Set the message for the alert box
      am = "This function is disabled!";
       
      // do not edit below this line
      // ===========================
      bV&nbsp; = parseInt(navigator.appVersion)
      bNS = navigator.appName=="Netscape"
      bIE = navigator.appName=="Microsoft Internet Explorer"
       
      function nrc(e) {
      &nbsp;  if (bNS && e.which > 1){
      &nbsp; &nbsp; &nbsp; alert(am)
      &nbsp; &nbsp; &nbsp; return false
      &nbsp;  } else if (bIE && (event.button >1)) {
      &nbsp; &nbsp;  alert(am)
      &nbsp; &nbsp;  return false;
      &nbsp;  }
      }
       
      document.onmousedown = nrc;
      if (document.layers) window.captureEvents(Event.MOUSEDOWN);
      if (bNS && bV<5) window.onmousedown = nrc;
       
      </script>
       
      ============================================================
    • Do not go where the path may lead, go instead where there is no path and leave a trail.
    • Brett Youlten's Avatar

    Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • thankyou sure LurksAlot,but i actually unintentionally deleted the index.html file ..have index.php .how and where do i incorporate that into the script?
    • Mack's Avatar
    • Mack
    • Elite Rocketeer
    • Posts: 535
    • Thanks: 0

    Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • Brett Youlten's Avatar

    Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • All i wanted to do was disable the right-click completely ...where do i put that script form SirLurkAlots in the index.php file?
    • GollumX's Avatar
    • GollumX
    • Elite Rocketeer
    • Posts: 2817
    • Thanks: 0

    Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • Brett Youlten wrote:
      All i wanted to do was disable the right-click completely ...where do i put that script form SirLurkAlots in the index.php file?

      like it says in the script posted by surelurksalot (above), in the head section of your file (between <head> and </head>). I would put it immediately after the other scripts.
    • Say no to Internet Explorer 6.
      twitter.com/mark_up
    • Brett Youlten's Avatar

    Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • GollumX wrote:
      Brett Youlten wrote:
      All i wanted to do was disable the right-click completely ...where do i put that script form SirLurkAlots in the index.php file?

      like it says in the script posted by surelurksalot (above), in the head section of your file (between <head> and </head>). I would put it immediately after the other scripts.

      but there is no <head> or </head> in my index.php file?.. i did add it at the end and it didnt work?
    • JEM's Avatar
    • JEM
    • Preeminent Rocketeer
    • Posts: 17917
    • Thanks: 4

    Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • GollumX's Avatar
    • GollumX
    • Elite Rocketeer
    • Posts: 2817
    • Thanks: 0

    Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • Brett Youlten wrote:
      but there is no <head> or </head> in my index.php file?.. i did add it at the end and it didnt work?

      if you are looking at the correct index.php, there are head tags there. the index.php in question is:
      siteroot/templates/[template_name]/index.php

      In regards to the post by Mr. Middleton, he is correct and this has already been covered heaps of times in these forums. Bascially there is no way to protect your pics except by watermarking them, which is often undesirable. The no-right click and other basic measures will only prevent the noobs from taking your pics.
    • Say no to Internet Explorer 6.
      twitter.com/mark_up
    • Brett Youlten's Avatar

    Re: Disabling right-click on a site..

    Posted 17 years 9 months ago
    • thankyou for verifying that for me lads..ive decided i wont disallow it after reading some of those links, i often right-click to open new window myself and yea..it is a bit 'limited' for the user..

      thanx again.

Time to create page: 0.066 seconds