Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Right click deny : is it possible ?
12-04-2010, 07:19 PM
Post: #1
Question Right click deny : is it possible ?
Hi,


Very nice script! HeartHeartHeart

A need to a better protection from copying the images : is there a simple way to disable right click when the mouse goes on a photo?

The best thing to me should be to deny right click making this command equivalent to the action of the ESC key :
Right click = ESC => the photo disappears when the visitor right clicks on it.

So is it possible, and in which file?


Thanks a lot,



PhilJ
Visit this user's website Find all posts by this user
Quote this message in a reply
12-09-2010, 12:49 AM
Post: #2
RE: Right click deny : is it possible ?
(12-04-2010 07:19 PM)PhilJ Wrote:  A need to a better protection from copying the images : is there a simple way to disable right click when the mouse goes on a photo?

The best thing to me should be to deny right click making this command equivalent to the action of the ESC key :
Right click = ESC => the photo disappears when the visitor right clicks on it.

So is it possible, and in which file?

I don't like the idea behind this. You don't get any better protection of your images if you disable right click. Every picture is still accessible. For example you can simply drag'n'drop the pictures into a new tab and then save them easily. If somebody really wants to copy your images you can't prevent it.

KoschtIT Image Gallery developer
Visit this user's website Find all posts by this user
Quote this message in a reply
12-09-2010, 02:35 AM
Post: #3
RE: Right click deny : is it possible ?
kkokus Wrote:[...] You don't get any better protection of your images if you disable right click. Every picture is still accessible. For example you can simply drag'n'drop the pictures into a new tab and then save them easily. If somebody really wants to copy your images you can't prevent it.
--------------------------

Hi,


Yes, I know that there is no absolute mean to prevent copying a picture, but disabling right click can discourage many users.

About drag'n'drop the picture into a new tab : I used a kind of gallery in which the left click closed the picture too, very efficiently preventing from copy. In Koschtit galleries, the visitors can operate with both right and left click, so the protection is inexistant.

Could you please tell me in which file(s) I could have a look at the code?

Thanks a lot,



PhilJ
Visit this user's website Find all posts by this user
Quote this message in a reply
12-09-2010, 11:38 AM
Post: #4
RE: Right click deny : is it possible ?
(12-09-2010 02:35 AM)PhilJ Wrote:  Could you please tell me in which file(s) I could have a look at the code?

You will need to edit "ki_js_view.php". Do the following:

1. Add this code to the "this.constr" - function:

PHP Code:
<?php addEvent("document""mousedown""norightclick"); ?>
<?php addEvent
("document""contextmenu""norightclick"); ?>
<?php addEvent
("document""click""norightclick"); ?>

2. Add this code to the "this.destr" - function:

PHP Code:
<?php removeEvent("document""mousedown""norightclick"); ?>
<?php removeEvent
("document""contextmenu""norightclick"); ?>
<?php removeEvent
("document""click""norightclick"); ?>

3. Add this function to the "kiv_module" - class:

PHP Code:
function norightclick(aEvent){
        
aEvent aEvent aEvent window.event;
        if ((
aEvent.type && aEvent.type == "contextmenu") || (aEvent.button && aEvent.button == 2) || (aEvent.which && aEvent.which == 3)) {
            
kiv.closeImage();
            if(
aEvent.preventDefault)aEvent.preventDefault();
            if(
aEvent.stopPropagation)aEvent.stopPropagation();
            return 
false;
        }
    } 

KoschtIT Image Gallery developer
Visit this user's website Find all posts by this user
Quote this message in a reply
12-09-2010, 03:44 PM
Post: #5
RE: Right click deny : is it possible ?
Thank you very much Smile



PhilJ
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)