Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
NeapolitanWorld
Involved
Involved



Joined: Nov 06, 2005
Posts: 339
Location: Los Angeles, USA

PostPosted: Thu Mar 18, 2010 1:47 pm Reply with quote

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 Very Happy

Best,
jc

_________________
My Raven Site Neapolitan Mastiff 
View user's profile Send private message
wHiTeHaT
Life Cycles Becoming CPU Cycles



Joined: Jul 18, 2004
Posts: 579

PostPosted: Thu Mar 18, 2010 2:06 pm Reply with quote

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?
 
View user's profile Send private message Send e-mail
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Thu Mar 18, 2010 2:10 pm Reply with quote

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 (story) [ Only registered users can see links on this board! Get registered or login! ]

if you try to save the images you will see what i mean Wink
 
View user's profile Send private message Visit poster's website
NeapolitanWorld







PostPosted: Thu Mar 18, 2010 3:26 pm Reply with quote

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? Very Happy
 
NeapolitanWorld







PostPosted: Thu Mar 18, 2010 3:57 pm Reply with quote

BTW This is for a large coppermine gallery but would also like to have it on the entire site.
 
spasticdonkey







PostPosted: Fri Mar 19, 2010 7:09 am Reply with quote

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. Smile

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 [ Only registered users can see links on this board! Get registered or login! ]

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 Wink
 
NeapolitanWorld







PostPosted: Fri Mar 19, 2010 4:14 pm Reply with quote

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

PostPosted: Fri Mar 19, 2010 4:36 pm Reply with quote

Are you sure Coppermine doesn't already have a watermarking feature?
 
View user's profile Send private message Send e-mail
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Sun Mar 21, 2010 2:43 am Reply with quote

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. Wink
 
View user's profile Send private message
NeapolitanWorld







PostPosted: Mon Mar 22, 2010 1:18 am Reply with quote

Guardian2003, the last release for php nuke does not have watermark Sad
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

PostPosted: Mon Mar 22, 2010 11:03 am Reply with quote

no right click = security through obscurity
It just doesn't work. Try it in the Opera browser Laughing
Try Ctrl+I in Firefox, go to the "Media" tab and click [Save As...]
In Internet Explorer see the image toolbar on images [ Only registered users can see links on this board! Get registered or login! ] or just open your "temporary internet files" folder

_________________
$ mount /dev/spoon /eat/fun auto,overclock 0 1
ERROR: there is no spoon [ Only registered users can see links on this board! Get registered or login! ] 
View user's profile Send private message Visit poster's website
Guardian2003







PostPosted: Mon Mar 22, 2010 12:03 pm Reply with quote

.. or just disable javascript
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Mar 22, 2010 7:51 pm Reply with quote

Or click the Edit option in/on the browser toolbar
 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6433

PostPosted: Mon Mar 22, 2010 8:57 pm Reply with quote

...or search Google Images, etc.

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
NeapolitanWorld







PostPosted: Fri Jun 11, 2010 10:39 pm Reply with quote

unicornio, killing me killing me killing me killing me killing me
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

PostPosted: Sat Jun 12, 2010 1:51 pm Reply with quote

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!! 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
djmaze







PostPosted: Sat Jun 12, 2010 4:28 pm Reply with quote

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? [ Only registered users can see links on this board! Get registered or login! ]
 
hicuxunicorniobestbuildpc







PostPosted: Sun Jun 13, 2010 5:07 pm Reply with quote

glad you liked it NeapolitanWorld. lol
 
eldorado
Involved
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Mon Jun 14, 2010 2:19 am Reply with quote

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.

_________________
United-holy-dragons.net (My RN site)- Rejekz(cod4 clan) - gamerslounge 
View user's profile Send private message Visit poster's website MSN Messenger
NeapolitanWorld







PostPosted: Mon Jun 14, 2010 11:03 pm Reply with quote

gregexp, would be great to see! keep us posted Very Happy
 
djmaze







PostPosted: Wed Jun 16, 2010 9:26 am Reply with quote

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
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©