Author |
Message |
NeapolitanWorld
Involved
Joined: Nov 06, 2005
Posts: 339
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 |
_________________ My Raven Site Only registered users can see links on this board! Get registered or login! |
|
|
|
wHiTeHaT
Life Cycles Becoming CPU Cycles
Joined: Jul 18, 2004
Posts: 579
|
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: 1693
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 ( Only registered users can see links on this board! Get registered or login!)
http://www.sohtanaka.com/web-design/examples/water-mark/
if you try to save the images you will see what i mean |
|
|
|
|
NeapolitanWorld
|
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
|
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
|
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
http://php.net/manual/en/function.getimagesize.php
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
|
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: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Fri Mar 19, 2010 4:36 pm |
|
Are you sure Coppermine doesn't already have a watermarking feature? |
|
|
|
|
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
Joined: Aug 13, 2009
Posts: 1123
|
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
|
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: 727
Location: http://tinyurl.com/5z8dmv
|
Posted:
Mon Mar 22, 2010 11:03 am |
|
no right click = Only registered users can see links on this board! Get registered or login!
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 http://technet.microsoft.com/en-us/library/dd361901.aspx or just open your "temporary internet files" folder |
_________________ $ mount /dev/spoon /eat/fun auto,overclock 0 1
ERROR: there is no spoon
http://claimedavatar.net/ |
|
|
|
Guardian2003
|
Posted:
Mon Mar 22, 2010 12:03 pm |
|
.. or just disable javascript |
|
|
|
|
Raven
Site Admin/Owner
Joined: Aug 27, 2002
Posts: 17088
|
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: 6437
|
Posted:
Mon Mar 22, 2010 8:57 pm |
|
...or search Google Images, etc. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
|
NeapolitanWorld
|
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. |
_________________ For those who stand shall NEVER fall and those who fall shall RISE once more!! |
|
|
|
djmaze
|
Posted:
Sat Jun 12, 2010 4:28 pm |
|
|
|
|
hicuxunicorniobestbuildpc
|
Posted:
Sun Jun 13, 2010 5:07 pm |
|
glad you liked it NeapolitanWorld. lol |
|
|
|
|
eldorado
Involved
Joined: Sep 10, 2008
Posts: 424
Location: France,Translator
|
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. |
_________________ Only registered users can see links on this board! Get registered or login! (My RN site)- Only registered users can see links on this board! Get registered or login!(cod4 clan) - Only registered users can see links on this board! Get registered or login! |
|
|
|
NeapolitanWorld
|
Posted:
Mon Jun 14, 2010 11:03 pm |
|
gregexp, would be great to see! keep us posted |
|
|
|
|
djmaze
|
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
|
|
|
|
|
|
|