Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Modpack addition - prevent right click save as  (Read 38121 times)

0 Members and 1 Guest are viewing this topic.

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Modpack addition - prevent right click save as
« on: June 11, 2006, 01:53:27 pm »

I've played a lil bit with the classic theme. I think you could use that for most of the themes if you just copy/ paste function theme_display_fullsize_pic() and function theme_html_picture() from the attached theme.php to the theme.php you're actually using (if the functions are not already in there). But it's tested only with the classic theme.

What it's doing.
It's displaying the image in the table background and a transparent gif over that image. If someone right clicks - saves as, he'll get the transparent gif instead of the displayed image. Good to fool newbs

you'll have to place the attached gif into your coppermine/images dir

the version for a standard coppemine can be found here http://forum.coppermine-gallery.net/index.php?topic=33782.msg157813#msg157813
« Last Edit: October 18, 2006, 04:20:32 pm by Stramm »
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

Megachip

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: Modpack addition - prevent right click save as
« Reply #1 on: June 11, 2006, 10:31:56 pm »

Another possibility, prevent full size images save.

In include/themes.inc.php change:

Quote
    <table>
      <tr>
            <td>
          <div id="content">
              <?php     echo  '<a href="javascript: window.close()"><img src="'
                . htmlspecialchars($imagedata['path']) . '" '
                . $imagedata['geometry']
                . 'alt="'
                . htmlspecialchars($imagedata['name'])
                . '" title="'
                . htmlspecialchars($imagedata['name'])
                . "\n" . $lang_fullsize_popup['click_to_close']
                . '" /></a><br />' ."\n";
               ?>
          </div>
        </td>
      </tr>
    </table>
in
Quote
    <div id="vordergrund" style="position:absolute; left:0px; top:0px;">
    <?php     echo  '<a href="javascript: window.close()"><img src="images/overlay.gif" '
                   . $imagedata['geometry']
                   . 'alt="'
                   . htmlspecialchars($imagedata['name'])
                   . '" title="'
                   . htmlspecialchars($imagedata['name'])
                   . "\n" . $lang_fullsize_popup['click_to_close']
                   . '" /></a><br />' ."\n";
               ?>
    </div>
    <table>
      <tr>
            <td>
              <?php     echo  '<img src="'
                . htmlspecialchars($imagedata['path']) . '" '
                . $imagedata['geometry']
                ."\n";
               ?>
        </td>
      </tr>
    </table>
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: Modpack addition - prevent right click save as
« Reply #2 on: June 12, 2006, 07:26:56 am »

don't edit themes.inc.php but copy the function/ var in question from themes/sample/theme.php to the theme.php you're actually using.

Haven't tried Megachips solution but it seems to work pretty well lfor the fullsized view
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

nbgeekguy

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Modpack addition - prevent right click save as
« Reply #3 on: June 14, 2006, 03:43:39 am »

OK, what I did seems to prevent 90% of users on the web from downloading the images. I took the two functions from the sample theme and added them to my theme, added Megachip's hack, then added a little right click script to my theme template.html. As the fullsize window is opened by a java script, they must have java script enabled to view the image, but at the same time another java script prevents them from right clicking and viewing source.

Code: [Select]
<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>

The next thing I will try is to add another table to the mix that I can throw a watermark into the mix to at least have my watermark on the image if they do the Print Screen copy to paste into Paint.

I'm also going to try one of the script redirectors to prevent them from looking at the cached copy of the page to find the URL of the image.
Logged

ianc

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Modpack addition - prevent right click save as
« Reply #4 on: August 17, 2006, 02:01:08 am »

Just a heads up with this one... I've just tried loading the Modpack addition after previously failing to get the previous version at: http://forum.coppermine-gallery.net/index.php?topic=33782.0 to work.

Both versions don't display any intermediate image using the classic view. Both of the mods I tried display a white area where the intermediate images should be.

If the mods work in a general environment, then there could possibly be a conflict with the full size photo access control plug-in at:http://forum.coppermine-gallery.net/index.php?topic=25010.0 which I'm using.

Thought you might like to know..
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: Modpack addition - prevent right click save as
« Reply #5 on: August 17, 2006, 07:40:36 am »

if a plugin changes one of the functions theme_html_picture, theme_display_fullsize_pic then that's probably the reason why it's not working.

edit: tried and works smooth for me
« Last Edit: August 18, 2006, 08:54:30 am by Stramm »
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Modpack addition - prevent right click save as
« Reply #6 on: January 18, 2007, 02:23:06 am »

To prevent "right click / save as", I added the following into my theme.html file:

Code: [Select]
<script language='JavaScript' src='no_right_click.js' type='text/javascript'></script>
This then links into a JS file in the root of the gallery which has the following in it:

Code: [Select]
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100%" height="19" align="middle">');
document.write('    <param name="allowScriptAccess" value="sameDomain" />');
document.write('    <param name="movie" value="themes/brummies/images/menu.swf" />');
document.write('    <param name="quality" value="high" />');
document.write('    <param name="wmode" value="transparent" />');
document.write('<embed src="themes/brummies/images/menu.swf" wmode="Transparent" quality="high" width="100%" height="19" name="logo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');

Nt sure about the strengths and weaknesses of the relative ways of doing the same thing and have in any case become dismayed in discovering that there is a plug-in to IE7 that gets around all these protections anyway.




Logged

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Modpack addition - prevent right click save as
« Reply #7 on: January 18, 2007, 02:25:09 am »

oops, that should have been the "template.html" file in my theme

See the results in action here:

www.ukmartin.com/gallery/
Logged

Nibbler

  • Guest
Re: Modpack addition - prevent right click save as
« Reply #8 on: January 18, 2007, 01:26:37 pm »

Don't post about an unrelated script (that doesn't even work) on a mod thread.
Logged

Cath22

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Female
  • Posts: 77
    • Fotofantastic
Re: Modpack addition - prevent right click save as
« Reply #9 on: December 13, 2008, 03:42:29 pm »

Hi Stramm,
I like your "prevent right click" function, but I would also like to use the lightbox slideshow (http://forum.coppermine-gallery.net/index.php/topic,49596.msg276002.html#msg276002).
However the two collides unfortunately, since the code uses the same part. When clicking the intermediate the lightbox would start. The showing of the full picture would in that case also somewhat protected I guess, but the intermediate is yet not protected.
Upon changing the code to make the intermediate protected the whole lightbox does not work anymore. Im no coder so dont know how to change both to work next to each other. I left a post with on the other forum but got no reaction, thats why I try here.

Thanks in advance.
Cath
Logged
qui custodiet ipsos custodes

nyfalls

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Modpack addition - prevent right click save as
« Reply #10 on: December 23, 2008, 03:39:06 am »

This is a great mod and I have been using it successfully for a while. There seems to be one exploit though. The e-cards still have the capability to save as. Is there away to apply a variation of this mod to the e-card?
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 21 queries.