Author Topic: Right-Click disable? HELLLLLP!  (Read 18277 times)

0 Members and 1 Guest are viewing this topic.

Offline pinksteam413

  • Pre-Newbie
  • Posts: 3
    • View Profile
Right-Click disable? HELLLLLP!
« on: August 24, 2002, 08:32:23 PM »
Hi,

I just wanted to say first of all, wonderful script! This is by far the best image script I have found so far.

ok, and now the question. How do I disable to the "disable right click"?


Thanks, Sam

Offline Dan1113

  • Jr. Member
  • **
  • Posts: 72
    • View Profile
Right-Click disable? HELLLLLP!
« Reply #1 on: August 25, 2002, 04:19:19 AM »
Go to the Admin Control Panel -> Templates -> Edit header.html -> Remove this code:

Code: [Select]
<script language="javascript" type="text/javascript">
<!--
  function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
 
  function right(e) {
    if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by site_name");
      return false;
    }
    else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
      alert("© Copyright by site_name");
      return false;
    }
    return true;
  }
  document.onmousedown=right;
  if (document.layers) window.captureEvents(Event.MOUSEDOWN);
  window.onmousedown=right;
// -->
</script>


:)

Offline pinksteam413

  • Pre-Newbie
  • Posts: 3
    • View Profile
Right-Click disable? HELLLLLP!
« Reply #2 on: August 25, 2002, 04:51:10 PM »
ok now I get this error:

Quote
DB Error: Couldn't open Template-Pack ./../templates/default_wide




ahhh! what do i do?

Offline pinksteam413

  • Pre-Newbie
  • Posts: 3
    • View Profile
Right-Click disable? HELLLLLP!
« Reply #3 on: August 25, 2002, 04:53:05 PM »
also, when i go to change the permissions of the folder, I get this message in my ftp client:

Quote
550 /images/templates: Permission denied
PWD
257 "/images" is current directory.


that does this mean?

Offline Alan @ ArtScans

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • http://www.qcs-software.com
Right-Click disable? HELLLLLP!
« Reply #4 on: August 25, 2002, 04:57:51 PM »
Hi,

The easiest way would be to just download the template HEADER.HTML via FTP, remove the right-click restriction js, then upload it again.

Thanks,
Alan.
Alan Wagstaff,
Software Development Manager, SDT
QCS Software

Offline AshleyShea

  • Pre-Newbie
  • Posts: 4
    • View Profile
    • http://www.found-art.com
Reverse problem
« Reply #5 on: August 28, 2002, 08:27:41 PM »
I am new to using 4images gallery. I'm trying to make sure I know everything I can about it before I open the door to my members. One thing I would like is for all uploaded images to be protected. Even though I set preferences for no downloading, I was able to click on an image to download it.

By the sounds of this thread, disabling right clicks come standard with the gallery. But that hasn't been my experience. Is it only disabled on some browsers or some versions of browsers? I'm on a Mac using IE 5.1.

Thanks for your help!
Shari
 :?

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
Re: Reverse problem
« Reply #6 on: August 30, 2002, 03:28:44 PM »
Quote from: AshleyShea
I am new to using 4images gallery. I'm trying to make sure I know everything I can about it before I open the door to my members. One thing I would like is for all uploaded images to be protected. Even though I set preferences for no downloading, I was able to click on an image to download it.

By the sounds of this thread, disabling right clicks come standard with the gallery. But that hasn't been my experience. Is it only disabled on some browsers or some versions of browsers? I'm on a Mac using IE 5.1.

Thanks for your help!
Shari
 :?


Your configuration kindly ignores this "disable right click". I mean even if right click disabling on a mac would work one could just drag and drop the image from the browser to the desktop. We mac users are fortunate here ;)

Btw. an easy way to come by the right-click thingy as a user: disable javascript ...

cheers,
Bernd

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Yeah but you can disable drag-and-drop too!
« Reply #7 on: September 01, 2002, 02:10:28 AM »
Okay.  We have a javascript that disables right clicking so we can prevent the user from saving our images.

Okay.  Javascript can be disabled by the user in their browser and we could go one step further and check for it before allowing them into the galleries.

But using IE, the user can still drag-and-drop the image from the browser onto their desktop.  Or can they???

You won't be able to do this from my website.  Saving the page using File>Save As... will produce an error.  Drag-and-drop the image and you'll get a spacer gif instead.  So how did I do it?

It's a simple technique and I've only tested it with jpeg files since that's all I'll be using on my site.  The concept is simple.  Make the table background the image itself and place a single pixel transparent gif in the table cell.  


Here's what I have in my media/jpg.html template:
Code: [Select]
<table width="{image_width}" height="{image_height}" border="0" cellspacing="0" cellpadding="0" background="{media_src}">
<tr>
<td><img src="{template_url}/images/spacer.gif" width="{image_width}" height="{image_height}" alt="" />
</td>
</tr>
</table>


Obviously this technique requires {image_height} and {image_width}.  That means the images must be stored locally on the server or your database must have the information.

For a complete solution, you should also ensure the user's browser has javascript enabled to prevent them from right clicking and selecting "Save background as..."

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Disabling drap and drop of images
« Reply #8 on: October 08, 2002, 04:38:18 PM »
I think adding the "ondragstart" attribute to the body tag will disable the ability to simply drag and drop images off your web page and onto the desktop.  It's worth a try.

Code: [Select]
<body ondragstart="return false">
</body>

And an easy way to ensure javascript is enabled is to place the following right after the body tag:
Code: [Select]
<noscript>
You must have javascript enabled in your browser to view this page.
</noscript>

Now if I can just find a way to prevent the image from being saved with a page when the user tries File>Save from their browser...