Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Can you block download?  (Read 6254 times)

0 Members and 2 Guests are viewing this topic.

twdmcrider

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Can you block download?
« on: June 07, 2006, 08:18:40 pm »

Can you block right click downloading of your pictures on Coppermine?  I know that someone could just do a print screen, but at least this would stop some from downloading images.  Thanks for your help.

Matt
« Last Edit: June 11, 2006, 01:56:35 pm by GauGau »
Logged

Nibbler

  • Guest
Re: Can you block download?
« Reply #1 on: June 07, 2006, 09:23:45 pm »

Please read the docs and search the board before posting. Thankyou.
Logged

dke

  • Guest
Re: Can you block download?
« Reply #2 on: June 10, 2006, 08:03:33 pm »

im wondering this aswell, ive searched and come up with nothing. Maybe im inserting the wrong query for search :/

EDIT: did some deeper searches and found this thread : http://forum.coppermine-gallery.net/index.php?topic=2450.0

but it seems none of these scripts work very well, any clue anyone know a good one that disable right click in all major browsers like explorer/firefox/opera ?
« Last Edit: June 10, 2006, 08:33:48 pm by dke »
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Can you block download?
« Reply #3 on: June 10, 2006, 08:55:54 pm »

There is no way to block downloading,it's the nature of html if you disable righ click they will simply save entire page and then take the picture , if you open up pop up they will pick it from their "internet temp" (browser cache).
I think you can only water marking your image at all.
Logged
‍I don't answer to PM with support question
Please post your issue to related board

dke

  • Guest
Re: Can you block download?
« Reply #4 on: June 10, 2006, 09:13:18 pm »

ofcourse, but you _CAN_ make it harder for people :) i will only have rookies surfing my page anyway since its a closed community one, and i dont want them comming there dayly just to download images and leave...

I would be very happy if anyone could paste me / link me to a WORKING disable right click script for "displayimages.php" the rest dosnt matter, its the full size images i dont want people to download easly.

IVe searched and none of the scripts ive found so far seems to do just this, they just disable right click in the <body> of the template.html which dosnt really matter for me at all, if people wanna save thumbnails then go ahead!
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Can you block download?
« Reply #5 on: June 10, 2006, 11:43:37 pm »

This is a cross browser DHTML script that will prevent the default right menu from popping up when the right mouse is clicked on the web page.
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>
Simply add the following code to the <BODY> section of your template.html
Logged
‍I don't answer to PM with support question
Please post your issue to related board

dke

  • Guest
Re: Can you block download?
« Reply #6 on: June 10, 2006, 11:54:59 pm »

i cant test that right now, but im quiet sure this will only block "right click" on the actuall page, once you click a thumbnail and get transported by some javascript to a single window with a full size picture in it , you are able to right click in that window, maybe im wrong! ill test it when avaible and ill get back to ya! thanks

EDIT: just tested as you said, and it didnt work. This will ONLY disable right clicking on the actuall page, but once you click a image (thumbnail) and get "full size" you will be able to right click that image. Anyone else have any ideas?
« Last Edit: June 11, 2006, 12:06:20 am by dke »
Logged

Nibbler

  • Guest
Re: Can you block download?
« Reply #7 on: June 11, 2006, 12:46:12 am »

To affect that page you'd need to add the code into a customised theme_display_fullsize_pic() function in your theme.php or into scripts.js.
Logged

dke

  • Guest
Re: Can you block download?
« Reply #8 on: June 11, 2006, 01:04:10 am »

hmm thanks for the hint nibbler, any chance you could be more specific to what that code would look like?

or am i supposed to insert the script parameters inside the () ? sorry for these questions but im a complete newbie on php/html mysql and all this, i try, i try :)
Logged

Nibbler

  • Guest
Re: Can you block download?
« Reply #9 on: June 11, 2006, 01:09:59 am »

Code: [Select]
// Display the full size image
function theme_display_fullsize_pic()
{
    global $CONFIG, $THEME_DIR, $ALBUM_SET;
    global $lang_errors, $lang_fullsize_popup, $lang_charset;

    if (isset($_GET['picfile']))
    {
        if (!GALLERY_ADMIN_MODE) cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);

    $picfile = $_GET['picfile'];
    $picname = $CONFIG['fullpath'] . $picfile;
    $imagesize = @getimagesize($picname);
    $imagedata = array('name' => $picfile, 'path' => path2url($picname), 'geometry' => $imagesize[3]);
    }
    elseif (isset($_GET['pid']))
    {
    $pid = (int)$_GET['pid'];
    $sql = "SELECT * " . "FROM {$CONFIG['TABLE_PICTURES']} " . "WHERE pid='$pid' $ALBUM_SET";
    $result = cpg_db_query($sql);

    if (!mysql_num_rows($result)) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);

    $row = mysql_fetch_array($result);
    $pic_url = get_pic_url($row, 'fullsize');
    $geom = 'width="' . $row['pwidth'] . '" height="' . $row['pheight'] . '"';
    $imagedata = array('name' => $row['filename'], 'path' => $pic_url, 'geometry' => $geom);
    }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
  <title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
      
?>
</title>
  <meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
  <script type="text/javascript" src="scripts.js"></script>
  <style type="text/css">
  body { margin: 0; padding: 0; background-color: gray; }
  img { margin:0; padding:0; border:0; }
  #content { margin:0 auto; padding:0; border:0; }
  table { border:0; height:100%; width:100%; border-collapse:collapse}
  td {         vertical-align: middle; text-align:center; }
  </style>
  </head>
  <body>
    <script language="JavaScript" type="text/JavaScript">
      adjust_popup();
    </script>
    <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>
    <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>
  </body>
</html>
<?php
}
Logged

dke

  • Guest
Re: Can you block download?
« Reply #10 on: June 11, 2006, 01:25:13 am »

you sir, is amazing!! thank you alot for this, MUCH appriciated! thanks again, have a nice weekend :)

EDIT: on another note, is there anyway to implent this code into that code you just gave me?
<meta http-equiv="imagetoolbar" content="no" />

im sure you know what that does, is there anyway? I played around some with the code you wrote for me, but couldnt do it, any chance you could be of assistance? thanks alot again for your time & help!
« Last Edit: June 11, 2006, 01:58:34 am by dke »
Logged

Nibbler

  • Guest
Re: Can you block download?
« Reply #11 on: June 11, 2006, 02:45:43 am »

Put it below the existing <meta> tag.
Logged

dke

  • Guest
Re: Can you block download?
« Reply #12 on: June 11, 2006, 11:29:30 am »

thanks sir! works like a charm!
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 15 queries.