PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
NeapolitanWorld
Involved
Involved


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

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

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
View user's profile Send private message Visit poster's website
wHiTeHaT
Involved
Involved


Joined: Jul 18, 2004
Posts: 431
Location: Netherlands

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

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 Visit poster's website MSN Messenger
spasticdonkey
RavenNuke(tm) Development Team


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

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

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 to the forums!
)
Only registered users can see links on this board!
Get registered or login to the forums!


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


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

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

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
View user's profile Send private message Visit poster's website
NeapolitanWorld
Involved
Involved


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

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

BTW This is for a large coppermine gallery but would also like to have it on the entire site.
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


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

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

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 to the forums!


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


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

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

spasticdonkey, Thanks I'll give it a try over the weekend!

jc
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6300
Location: Vsetin, Czech Republic

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

Are you sure Coppermine doesn't already have a watermarking feature?
View user's profile Send private message Send e-mail Visit poster's website
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

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

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
Involved
Involved


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

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

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.
View user's profile Send private message Visit poster's website
djmaze
Subject Matter Expert


Joined: May 15, 2004
Posts: 689
Location: http://tinyurl.com/5z8dmv

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

no right click =
Only registered users can see links on this board!
Get registered or login to the forums!

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 to the forums!
or just open your "temporary internet files" folder
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6300
Location: Vsetin, Czech Republic

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

.. or just disable javascript
View user's profile Send private message Send e-mail Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

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

Or click the Edit option in/on the browser toolbar
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 5997

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

...or search Google Images, etc.
View user's profile Send private message
NeapolitanWorld
Involved
Involved


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

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

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
View user's profile Send private message Visit poster's website
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 Back to top

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


Joined: May 15, 2004
Posts: 689
Location: http://tinyurl.com/5z8dmv

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

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 to the forums!
View user's profile Send private message Visit poster's website
unicornio
Involved
Involved


Joined: Aug 13, 2009
Posts: 410

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

glad you liked it NeapolitanWorld. lol
View user's profile Send private message
eldorado
Involved
Involved


Joined: Sep 10, 2008
Posts: 366
Location: France

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

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.
View user's profile Send private message Visit poster's website MSN Messenger
NeapolitanWorld
Involved
Involved


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

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

gregexp, would be great to see! keep us posted Very Happy
View user's profile Send private message Visit poster's website
djmaze
Subject Matter Expert


Joined: May 15, 2004
Posts: 689
Location: http://tinyurl.com/5z8dmv

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

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
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum