| Author |
Message |
NeapolitanWorld Involved


Joined: Nov 06, 2005 Posts: 318 Location: Los Angeles, USA
|
Posted:
Thu Mar 18, 2010 1:47 pm |
|
Just wanted to get some input on best way to do a prevent right click on a RN Nuke site? on other cms they have a extension which works nice, but here I would imagine it would be to add a snippet of code. Question is, what file in RN would be best to add it to, and anyone have any handy code they can post
Best,
jc |
|
|
|
 |
wHiTeHaT Involved


Joined: Jul 18, 2004 Posts: 431 Location: Netherlands
|
Posted:
Thu Mar 18, 2010 2:06 pm |
|
You might not want to hear this , but i suggest you not use such code.
Disable rightclick is totaly useless and most of all , verry anoying.
It prevent users to open links from your page in another tab or window.
It prevents to 'simply' copy a text , what could be used for whatever , let's say do a search on google with it.
And atleast , it doesnt prevent anything to block someone from grabbing your content.
The list might have do's and donts , what is your intention with it , is it something specific? |
|
|
|
 |
spasticdonkey RavenNuke(tm) Development Team

Joined: Dec 02, 2006 Posts: 1253 Location: Texas, USA
|
Posted:
Thu Mar 18, 2010 2:10 pm |
|
you can probably just find a JavaScript that will disable right-click, but I've never been a real big fan of that, as I use right click to navigate for new tabs (at times).
Is this to protect images? If so, I would look at either watermarking the images or overlaying them with a transparent image.. so if someone does right click -> save as, they just get the transparent image. Not full-proof, but will discourage most users.
here is an example of an CSS technique ()
if you try to save the images you will see what i mean  |
|
|
|
 |
NeapolitanWorld Involved


Joined: Nov 06, 2005 Posts: 318 Location: Los Angeles, USA
|
Posted:
Thu Mar 18, 2010 3:26 pm |
|
spasticdonkey, thanks! that would be perfect. Yes it is mostly for images. What files in RN would be best to or should I edit for method 1?  |
|
|
|
 |
NeapolitanWorld Involved


Joined: Nov 06, 2005 Posts: 318 Location: Los Angeles, USA
|
Posted:
Thu Mar 18, 2010 3:57 pm |
|
BTW This is for a large coppermine gallery but would also like to have it on the entire site. |
|
|
|
 |
spasticdonkey RavenNuke(tm) Development Team

Joined: Dec 02, 2006 Posts: 1253 Location: Texas, USA
|
Posted:
Fri Mar 19, 2010 7:09 am |
|
No easy way to implement site-wide, as it requires changes to the code. I'm not real familiar with coppermine, might take some work to implement, but it's possible.
You need to know the height and width of the image. So something like this:
<img src="'.$url.'" width="'.$width.'" height="'.$height.'" />
becomes
<div style="width:'.$width.'px; height:'.$height.'px;background: url('.$url.');">
<img src="SomeTransparentGIF.gif" width="'.$width.'" height="'.$height.'" />
</div>
I would only bother implementing for large images, no sense going thru the trouble for thumbnails.. Probably a good idea to make note of your changes too, if you need to update coppermine later.
Also note that anyone familiar with html can look at the code to find the image... If you display an image on a webpage it's impossible to completely protect it, without physically altering it with a watermark.
If coppermine does not include width/height for the image you could probably add a little php to retrieve them, something like
BTW, the above example does not add a watermark (or actually simulate a watermark, the image remains untouched), but you could tweak to do so..
CSS
| Code: | .watermark {background:transparent url(path-to-your-watermark-image.png);}
.makeopaque {
/* for IE */
filter:alpha(opacity=90);
/* CSS3 standard */
opacity:0.9;} |
<div class="watermark"><div class="makeopaque" style="width:'.$width.'px; height:'.$height.'px;background: url('.$url.');">
<img src="SomeTransparentGIF.gif" width="'.$width.'" height="'.$height.'" />
</div></div>
Another side effect of this method is the image will usually NOT display when printed either... Unless the user wants to use $5 worth of ink to print the page, and has "print background images" = ON  |
|
|
|
 |
NeapolitanWorld Involved


Joined: Nov 06, 2005 Posts: 318 Location: Los Angeles, USA
|
Posted:
Fri Mar 19, 2010 4:14 pm |
|
spasticdonkey, Thanks I'll give it a try over the weekend!
jc |
|
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6300 Location: Vsetin, Czech Republic
|
Posted:
Fri Mar 19, 2010 4:36 pm |
|
Are you sure Coppermine doesn't already have a watermarking feature? |
|
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Sun Mar 21, 2010 2:43 am |
|
Morning everybody
Neapolitanworld
I created my own NO RIGHT CLICK long time ago. This is a very funny and painful no right click, working on FF and IE.
Create a norightclick.js and upload it to your root where config.php is
| Code: | <!--
zaehler=0;
function right(e) {
if (navigator.appName == 'Netscape'){
if (e.which == 3 || e.which == 2){
alert("Here at MYSITE is not allow right click on the mouse");
for(i=0;i!=zaehler;i++)alert("I told you very clear, I will punish you with \n "+(zaehler-i)+"\n clicks.");
zaehler+=20;
alert("Next Time will be worse");
return false;}}
if (navigator.appName == 'Microsoft Internet Explorer'){
if (event.button == 2 || event.button == 3){
alert("Here at MYSITE is not allow right click on the mouse");
for(i=0;i!=zaehler;i++)alert("I told you very clear, I will punish you with \n "+(zaehler-i)+"\n clicks.");
zaehler+=20;
alert("Next Time will be worse");
return false;}}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// --> |
call this script from header.php
?>
<script type="text/javascript" src="norightclick.js"> </script>
<?php
I hope you like it. Let me know
This is for the entire site.  |
|
|
|
 |
NeapolitanWorld Involved


Joined: Nov 06, 2005 Posts: 318 Location: Los Angeles, USA
|
Posted:
Mon Mar 22, 2010 1:18 am |
|
Guardian2003, the last release for php nuke does not have watermark
wHiTeHaT, Kinda thinking the same thing because I hate it myself lols.
unicornio, how to call the script, wanted to test it but when I add to header.php my site goes blank. |
|
|
|
 |
djmaze Subject Matter Expert

Joined: May 15, 2004 Posts: 689 Location: http://tinyurl.com/5z8dmv
|
Posted:
Mon Mar 22, 2010 11:03 am |
|
no right click =
It just doesn't work. Try it in the Opera browser
Try Ctrl+I in Firefox, go to the "Media" tab and click [Save As...]
In Internet Explorer see the image toolbar on images or just open your "temporary internet files" folder |
|
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6300 Location: Vsetin, Czech Republic
|
Posted:
Mon Mar 22, 2010 12:03 pm |
|
.. or just disable javascript |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16976 Location: Kansas
|
Posted:
Mon Mar 22, 2010 7:51 pm |
|
Or click the Edit option in/on the browser toolbar |
|
|
|
 |
kguske Site Admin

Joined: Jun 04, 2004 Posts: 5997
|
Posted:
Mon Mar 22, 2010 8:57 pm |
|
...or search Google Images, etc. |
|
|
|
 |
NeapolitanWorld Involved


Joined: Nov 06, 2005 Posts: 318 Location: Los Angeles, USA
|
Posted:
Fri Jun 11, 2010 10:39 pm |
|
unicornio,
I love it! lols
finally got some time to add this...funny!
I noticed it only works when the user is logged in. This is still good for me since my gallery is only visible to registered.
jc |
|
|
|
 |
gregexp The Mouse Is Extension Of Arm

Joined: Feb 21, 2006 Posts: 1497 Location: In front of a screen....HELP! lol
|
Posted:
Sat Jun 12, 2010 1:51 pm |
|
One thing you might want to look for, and use a right click menu. It's the same amount of security as having no-right click.
If this is for images, then one thing you could do is force a watermark with gd.
I'm thinking about writing an addon for nuke that parses image codes before the source is pushed out, then uses it's own parser to change the links to a watermark all images module, which will hide the real url of the image, and force it to be an image with a watermark over it. |
|
|
 |
 |
djmaze Subject Matter Expert

Joined: May 15, 2004 Posts: 689 Location: http://tinyurl.com/5z8dmv
|
Posted:
Sat Jun 12, 2010 4:28 pm |
|
| NeapolitanWorld wrote: |
I noticed it only works when the user is logged in. This is still good for me since my gallery is only visible to registered.
jc |
You really think that?
|
|
|
|
 |
unicornio Involved


Joined: Aug 13, 2009 Posts: 410
|
Posted:
Sun Jun 13, 2010 5:07 pm |
|
glad you liked it NeapolitanWorld. lol |
|
|
|
 |
eldorado Involved


Joined: Sep 10, 2008 Posts: 366 Location: France
|
Posted:
Mon Jun 14, 2010 2:19 am |
|
| gregexp wrote: | One thing you might want to look for, and use a right click menu. It's the same amount of security as having no-right click.
If this is for images, then one thing you could do is force a watermark with gd.
I'm thinking about writing an addon for nuke that parses image codes before the source is pushed out, then uses it's own parser to change the links to a watermark all images module, which will hide the real url of the image, and force it to be an image with a watermark over it. |
use gd image to cut the image in several parts during parsing .
edit ;: just realised this was right click posts...
Oh... bad idea , right clicking *new tech* and rather good and well implemented on some sites.... i suggest you use some server side prevention rather than client side. |
|
|
|
 |
NeapolitanWorld Involved


Joined: Nov 06, 2005 Posts: 318 Location: Los Angeles, USA
|
Posted:
Mon Jun 14, 2010 11:03 pm |
|
gregexp, would be great to see! keep us posted  |
|
|
|
 |
djmaze Subject Matter Expert

Joined: May 15, 2004 Posts: 689 Location: http://tinyurl.com/5z8dmv
|
Posted:
Wed Jun 16, 2010 9:26 am |
|
| eldorado wrote: | | gregexp wrote: | | i suggest you use some server side prevention rather than client side. |
That's easy with htaccess.
Just route thru a php script that detects if you're a valid member then fpassthru() the image
inside coppermine directory |
| Code: |
RewriteRule 'albums/(.*)' security.php?img=$1
|
|
|
|
|
 |
|
|
|
|