forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: Stramm on July 12, 2006, 09:43:57 am

Title: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on July 12, 2006, 09:43:57 am
That's a lil theme addition. So you won't need to modify core files. This addition puts a transparent gif over the actual intermediate or fullsized image. If a user tries to download the image he only gets the transparent gif. Same if he tries to find out the URL (with tight click -> properties). This is no 100% secure solution but protects against most newbies and lazy users. Also it's 100 times better than blocking the right mouse button (at least I hate sites that use that techniques and leave)

Installation: unzip the attachment and open the txt file. It's contents copy into the theme.php you're actually using or want to use the transparent gif overlay on (right above the final ?>).
In most cases that's it. If however the two included functions are already in your theme.php (function theme_html_picture, function theme_display_fullsize_pic) then please ask here what to modify exactly.

Finally copy the overlay.gif into your coppemine/images directory

the modpack version can be found here
http://forum.coppermine-gallery.net/index.php?topic=32548.0

Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Abbas Ali on July 12, 2006, 10:15:15 am
What about overlay.gif? Do we need to create that image file or you forgot to attach it to the post?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on July 12, 2006, 10:22:35 am
thanks for the hint, I've totally forgotten about it
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: tantley on August 13, 2006, 08:17:38 pm
This is an excellent mod that works instantly.  ;D

I was very impressed that it only took about three minutes to download, install, and check for proper operation.

As a side note for future CPG versions, if this could be implemented (on or off) through the admin config options, it would be a great feature.

Thanks for writing and sharing this great feature!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 14, 2006, 03:25:03 am
nifty little tweek...

is there a way to tie this into "members only" and remove this of logged in?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on August 14, 2006, 08:00:30 am
This is an excellent mod that works instantly.  ;D

I was very impressed that it only took about three minutes to download, install, and check for proper operation.

As a side note for future CPG versions, if this could be implemented (on or off) through the admin config options, it would be a great feature.

Thanks for writing and sharing this great feature!

Thanks :)
and it's scheduled to be in the next cpg version
http://forum.coppermine-gallery.net/index.php?topic=33176.msg154902#msg154902
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on August 14, 2006, 08:03:29 am
of course possible. Basically you compare the modified functions with the original ones. Copy the changes into the original function and pack them in a if/ else clause
if (!USER_ID){...}  //for the not logged in user
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 18, 2006, 05:18:18 am
a thought...

this gif overlay covers tnail and intermediat picture...

does it also cover full size image?

i have looked at this and it seems full size image is not covered... is this correct?

if true, how could we disable, in config, full size view for non registered users?

this way drive-bys could not access images until theytook the time to register...

thoughts?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 18, 2006, 06:00:59 am
getting closer...

i have installed Full-Size Photos Access Control
http://forum.coppermine-gallery.net/index.php?topic=25010.msg117873#msg117873

now i am going to try to add this gif thing...
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 18, 2006, 06:20:18 am
ok added mod as directed...

i have image display problems...

i am using 'rainy day' theme ...

actual images show in the case of no larger size (original load was smaller than intermediate)

i have successfully added the "Full-Size Photos Access Control"

and there must be a conflict...

link to image with no large size in db:  http://www.wireservicefree.net/florist_image_exchange/displayimage.php?album=topn&cat=0&pos=17

link to image with large size in db: http://www.wireservicefree.net/florist_image_exchange/displayimage.php?album=random&cat=0&pos=-125

many thanks
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 18, 2006, 06:28:12 am
footnote:

images all work if logged in....

the blank images only seem to effect not logged in users...

also....

Quote
This addition puts a transparent gif over the actual intermediate or fullsized image.

how do we switch between 'intermediate or fullsized'?

my goal is to have fullsized unrestrictes (no overlay.gif)

many thanks
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on August 18, 2006, 08:41:23 am
As said, the gif overlay covers the intermediate and fullsize image. If you want to exclude one, then you don't copy the function in question to your theme.php (function theme_html_picture, function theme_display_fullsize_pic).

The fullsize access control plugin I'd say modifies one of the two functions (the one for the fullsize popup) as well - > again, either don't copy the fullsize popup function from the zip to your theme.php, modify it to include the plugins changes or modify the plugin. This is what I meant in my first post
Quote
If however the two included functions are already in your theme.php
A plugin may add that function without you seeing it in the theme.php

edit: I've just tried the fullsize acvcess control plugin with 4 more other plugins and the transparent gif overlay.. all working smooth as butter
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: dragonwolf on August 18, 2006, 10:33:01 am
I got the mod working for an admin user just fine, but all I get for normal users is a white image. I'm using the eyeball theme. Anyone got any ideas?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 18, 2006, 04:58:52 pm
--->normal users is a white image

this is what i have...

hmmm
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 18, 2006, 05:20:39 pm
hey dragonwolf ...

try loadig an image that is smaller than your 'intermediate' as defined in config - i bet the image will show!

seems the intermediate sized images are getting lost...

i think the overlay mod somehow is not looking for 'intermediate sized images'...

Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: dragonwolf on August 18, 2006, 07:39:11 pm
I uploaded a thumbnail image and it can be viewed. My intermediate size is set to 600. The uploaded images are 1800 x 1197 at full size. I also have the Full-Size Access control and I have full-size disabled for all users so I didn't put the function

theme_display_fullsize_pic()

into the theme.php

That didn't seem to make a difference.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 18, 2006, 08:15:10 pm
try to load a pic that is smaller than 600

i bet it will work -
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: dragonwolf on August 18, 2006, 08:23:24 pm
I set one to exactly 600 and it worked. If I have to, I can resize all pics 600, but if there's a code mod I can do that would be better.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: xx-07 on August 18, 2006, 10:23:04 pm
U and Me - seem to have the same problem...

this tweek is not looking for intermediate images for guest level perms...

please ntoe we are bidge phpBB 2.0.13

thoughts?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Fudgemaster on August 20, 2006, 05:03:57 pm
Thanks Stramm, works like a charm.
If I only knew how to edit the code to make this overlay thingamajigger to work
with this -> http://forum.coppermine-gallery.net/index.php?topic=33581
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on August 21, 2006, 08:05:44 am
that's the overlay thingie for the MODPACK that doesn't open the fullsized but the next pic when clicking on the intermediate image.

I've commented every change I did for the next pic mod so it should be pretty easy to port that to the non modpack version

Code: [Select]
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
    global $album, $comment_date_fmt, $template_display_media;
    global $lang_display_image_php, $lang_picinfo, $mime_content;

    //mod next pic
    global $pos;
//end mod

    $pid = $CURRENT_PIC_DATA['pid'];
    $pic_title = '';

    if (!isset($USER['liv']) || !is_array($USER['liv'])) {
        $USER['liv'] = array();
    }
    // Add 1 to hit counter
    if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

    if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='ex' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }else{
     $condition = false;
    }

    if ($CURRENT_PIC_DATA['title'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if ($CURRENT_PIC_DATA['caption'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if ($CURRENT_PIC_DATA['keywords'] != '') {
        $pic_title .= $lang_picinfo['Keywords'] . ": " . $CURRENT_PIC_DATA['keywords'];
    }

    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }

    $CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }

    //$image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);
    $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width'], "normal");

    $pic_title = '';
    //$mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);


    if ($mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
            $CURRENT_PIC_DATA['pwidth']  = 320; // Default width

            // Set default height; if file is a movie
            if ($mime_content['content']=='movie') {
                $CURRENT_PIC_DATA['pheight'] = 240; // Default height
            }
        }

        $ctrl_offset['mov']=15;
        $ctrl_offset['wmv']=45;
        $ctrl_offset['swf']=0;
        $ctrl_offset['rm']=0;
        $ctrl_offset_default=45;
        $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if ($mime_content['content']=='image') {

            //mod next pic
        $next = $pos + 1;
        $next_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&pos=$next$uid_link";
//end mod

//mod next pic
        //if (isset($image_size['reduced'])) {
$imginfo=getimagesize($picture_url);
            $winsizeX = $CURRENT_PIC_DATA['pwidth'];  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']; //the +'s are the mysterious FF and IE paddings

$pic_html = "<table cellpadding=0 cellspacing=0><tr><td background=\"" . $picture_url . "\" width={$imginfo[0]} height={$imginfo[1]} class=\"image\">";
           
            //mod next pic
//$pic_html .= "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_html .= "<a href=\"  $next_tgt  \">";   //click on the intermediate photo will link to the next photo
//end mod

$pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"images/overlay.gif\" width={$imginfo[0]} height={$imginfo[1]}  border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n </td></tr></table>";
       
/* mod next pic
} else {
$pic_html = "<table cellpadding=0 cellspacing=0><tr><td background=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\">";
            $pic_html .= "<img src=\"images/overlay.gif\" {$image_size['geom']} border=\"0\" alt=\"\" /><br />\n";
            $pic_html .= "</td></tr></table>";
end mod */

    } elseif ($mime_content['content']=='document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        $autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        $players['WMP'] = array('id' => 'MediaPlayer',
                                'clsid' => 'classid="" ',
                                'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                'mime' => 'type="application/x-mplayer2" ',
                               );
        $players['RMP'] = array('id' => 'RealPlayer',
                                'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                'codebase' => '',
                                'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               );
        $players['QT']  = array('id' => 'QuickTime',
                                'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                'mime' => 'type="video/x-quicktime" '
                               );
        $players['SWF'] = array('id' => 'SWFlash',
                                'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                'mime' => 'type="application/x-shockwave-flash" '
                               );
        $players['UNK'] = array('id' => 'DefaultPlayer',
                                'clsid' => '',
                                'codebase' => '',
                                'mime' => ''
                               );

        if (isset($_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            $user_player = $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            $user_player = $mime_content['player'];
        }

                // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

        $player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }

    $CURRENT_PIC_DATA['html'] = $pic_html;
    $CURRENT_PIC_DATA['header'] = '';
    $CURRENT_PIC_DATA['footer'] = '';

    $CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return template_eval($template_display_media, $params);
}
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Chili on October 15, 2006, 03:44:13 am
Stramm,  This works very well for me, thank you.  One question, is it possible to get this to protect the photos in the slideshow as well?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on October 16, 2006, 08:19:35 am
I'm nearly sure it's possible. Will have a look in a free min
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: jsmith on October 18, 2006, 03:55:22 pm
I added this overlay and it makes the intermediate image aprox. 1 and a half images wide by repeating part of the image.  I assume this has to do with the size of the overlay - when I switch to a different theme it is fine.  How do I fix this?  Most of my images are not square - either horiz. or vert. and I generally upload images no larger than 750 pixels on the long side.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on October 18, 2006, 04:15:12 pm
yep, I know about that problem... there's a lil leftover in the functions from testing... needs to be replaced

edit: code removed
I'm going to update the zip

Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: jsmith on October 18, 2006, 04:17:27 pm
I'll try that.  What do you mean about intermediate images disabled?  I thought the image you get when you click the thumbnail was the intermediate image?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on October 18, 2006, 04:35:13 pm
new zip is up... the theme mod differs between two states. Either you have intermediate pics enabled (in config) or not. Then it calculates the necessary overlay size

Yes, that's the intermediate image. If the orig is the same size or smaller than the intermediate, then the intermediate doesn't get created.

Try if it works for you... if not, please report back with a link to an image where the problems occur
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: jsmith on October 18, 2006, 04:51:14 pm
that fixed it.  Thanks !
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: nivons on October 27, 2006, 12:44:29 pm
Hi,

I have been unable to locate the "overlay.gif" file mentioned in this thread.  Any help in locating the same is appreciated.

TIA.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on October 27, 2006, 12:50:04 pm
ouch, I've fixed a problem in the script some days ago and removed the gif instead of the outdated code... can be found again now in the first post of this thread
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: nivons on October 27, 2006, 01:08:05 pm
Thanks for the super fast update!

However, the downloaded overlay.gif (43 bytes) file results in the intermediate and full size images both not showing up (a small box with black borders appears instead).

CPG 1.4.9 and theme.php are configured properly.  I can replace this GIF with another GIF and that one shows up over the intermediate and full size pics (but covers them up instead of displaying them through the overlay).

 
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on October 27, 2006, 01:37:30 pm
works perfect for me... just tried the uploaded gif and the code attachment.

Attach your theme.php in your next post
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: nivons on October 27, 2006, 08:54:05 pm
theme.php with overlay.txt copied in right before final "?>" on last line attached.

Tried include contents of overlay.txt in the Classis theme's theme.php file with same results.

Note:  The only other change to vanilla CPG 1.4.9 that I have is the on-the-fly watermark enhancement (by flex) in functions.inc.php.  Reverting back to vanilla CPG 1.4.9 did not help above issue.

Thanks!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on October 28, 2006, 08:12:45 am
I've tested your theme file and it's working as expected. Can you post a link to your gallery?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: nivons on October 29, 2006, 01:04:48 am
Thank you for checking and confirming theme.php tests OK!

I was incorrect in stating that the "flex" on-the-fly watermark modifications did not causing overlays to not work.  After removing those modifications your transparent GIF overlay modification works great (cleared cache and restarted Web server this time).  Thank you for this great add-on to CPG functionality.

I would really like to see them both work together.  It appears that this issue is being caused due to the getimagesize() call in the overlay code in theme.php not getting input in a format it expects.

#Notices when overlay/watermarking not working
/themes/hardwired/theme.php

    * Warning line 310: getimagesize(watermark_normal.php?pid=1230&mode=normal): failed to open stream: No such file or directory

Attached is info on changes made to enable watermarking (diff to functions.inc.php, and contents of watermark_normal.php).

Hopefully the fix to overcome this issues is straightforward/simple.  If anyone is able to help with tips on how to effect that change or provide the fix, I would much appreciate it.

Thanks.

PS:  CPG web server is currently restricted to local/trusted network use and is not open to the Internet.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: nivons on October 29, 2006, 01:13:03 am
Attaching diff of functions.inc.php that didn't get attached to last post.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on October 29, 2006, 06:29:40 am
I would really like to see them both work together.  It appears that this issue is being caused due to the getimagesize() call in the overlay code in theme.php not getting input in a format it expects.

yes, the function you modified in functions.inc.php doesn't give back a path now getimagesize can handle. It expects a path to an actual image and not a URL to a script

simple solution would be to have to original get_pic_url function in your functions.inc.php again as eg get_pic_url2

then you need to do some lil changes in this mod (all untested)
find
Code: [Select]
    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }
replace with
Code: [Select]
    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
        $picture_url_orig = get_pic_url2($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        $picture_url_orig = get_pic_url2($CURRENT_PIC_DATA, 'fullsize');
    }

find
Code: [Select]
$imginfo=getimagesize($picture_url);
replace with
Code: [Select]
$imginfo=getimagesize($picture_url_orig);

but why would you want to use on the fly watermarking??? In a live environment it may suck a lot of resources. Imagine 20 peaople browsing your site... this can be enough to bog your server down. It's good for a family album but not for production use. I'd go for a permanent wm solution
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: nivons on October 29, 2006, 07:57:49 am
That worked perfect.  Thank you!

but why would you want to use on the fly watermarking??? In a live environment it may suck a lot of resources. Imagine 20 peaople browsing your site... this can be enough to bog your server down. It's good for a family album but not for production use. I'd go for a permanent wm solution

The user-base at this time is quite limited.  I did install and try out your mod for permanent WM, and may pick it back up in a later version of CPG.

Thanks again for your prompt and helpful responses, and for your contributions to CPG.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: cgc0202 on November 12, 2006, 04:14:56 pm
That's a lil theme addition. So you won't need to modify core files. This addition puts a transparent gif over the actual intermediate or fullsized image. If a user tries to download the image he only gets the transparent gif. Same if he tries to find out the URL (with tight click -> properties). This is no 100% secure solution but protects against most newbies and lazy users. Also it's 100 times better than blocking the right mouse button (at least I hate sites that use that techniques and leave)

Hi Stramm,

I am interested with this because my gallery sites are based on contributions from other people.  Some people may want to contribute but do not want anonymous users downloading their photos.  So, I wish to satisfy the concerns of such contributors, if possible:

So here are some observations and questions:
(1) Flickr has implemented a similar feature, but the easy way around it, as it turned out was to go to the thumbnail or mini-size URL, copy that URL and change the code used to identify "thumbnail" to the code for either the intermediate or large or original size.

Has this loophole been considered in this mode and dealt with?

One additional way to increase "security" from copying is to separate*** the URL address of original size from the derivative images.  I think it was Nibbler (or one of the Dev Team) who stated  in one response to an old post that they have a way to do just that -- separate location of original vs. intermediate.

(2) I understand that it would be a lot of work (for me as an administrator), but is there a way to make this applicable on per image basis?

If it is done per image basis, once this mode has been included, an expert coder might know how to integrate in the "Edit Files" window -- to add options to answer this:
Do you want to "prevent downloading of this photo"? No Yes.  And if yes: All, Int/Orig Orig only (where Int -> intermediate and Orig -> original)

The aforementioned per image option -- with the admin control included in the Edit files section -- would be much easier for non-programmers like me who could easily mess up a very complex php scrip.  Also, if one has multiple independent CPG galleries, it will minimize the php script modification, especially by non-programmers, that is needed during every update.

A per image basis is important for this mod because many contributing photographers have their photos under "Creative Commons (CC)" license, so there is no need to protect them from download.  However, protecting the original image even for CC files may be prudent for "small webpages" in shared-server hostings, where bandwidth usage is critical and also shared webhosting service providers frown upon "small webpages" causing bleeps due to upsurge of downloads 

(3) Is there a way to integrate this in the "Mod pack" Stramm?

I have other observations and questions but I will place them in another post.

CGC



Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on November 14, 2006, 05:21:18 pm
This mod is not meant as a full download protection. It just cheats newbs and is an alternative to blocking the right mouse button.

Of yourse you could modify CPG to save different filenames for thumbs, intermediate and fullsized images, however that needs some more modifications than just a few lines. Then you could save the images outside the webroot and not directly open them with an img tag but use a php script to show them.

Search the board for that mod. Disadvantage is a far higher CPU usage
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Joachim Müller on December 09, 2006, 10:20:19 am
Added this mod to devel branch of svn. This means that it will be available as a core feature (of course admin-settable) in cpg1.5.x.

Suggestions:
BTW: those who try to make their gallery standards-compliant should be aware that the HTML-attribute "background" is being considered deprecated. Therefor, applying this mod as-is will leave your gallery non-standards-compliant. You should then turn off the vanity blocks at the bottom as well. The reason for using the outdated background-attribute is obvious: if you used the standards-compliant method (using CSS attributes), some browsers would display a context menu entry "save background image", which would kick you back to square one.

Side-note: I have tested the mod in FF2, IE6 and Opera8.

Joachim
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: tiagobr on December 14, 2006, 06:31:52 pm
thanks!!!
overlay worked perfect!!!!

 ;)
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: shef on January 17, 2007, 10:03:25 pm
This seems like a great mod.  I have added it to my theme.php but it is not working for me in Firefox.  No image displays at all in firefox but it works just fine in IE7.  Any ideas?  Help would be really appreciated.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: uk_martin on January 18, 2007, 02:08:54 am
Side-note: I have tested the mod in FF2, IE6 and Opera8.

Joachim
A slightly disturbing development is that a freely downloadable "Pictures Toolbar" plug-in to IE7 searches out and downloads all images to several levels of link distance from any given base URL, a bit like "Web Whacker" thus rendering this sort of protection a little less reliable.

A possible weakness is that it searches for user defined filetypes. Thus if there are JPG files there, then they will be downloaded. If there are no JPG files, then it won't. I wonder if it would ever be possible to rename JPG files when adding them into Coppermine, giving them a random file extension (fixed file extensions would become known and lose their security as a result) which could then be "decoded" back to JPG at the time when a request comes in to view the images?

In other words, If I had "airplane.jpg" to upload, then when it got added to the gallery, the file (and its normal / intermediate "relatives") would be renamed and stored as "airplane.xyz" / normal_airplane.xyz" (for example). Then if the Pictures toolbar was used, the files wouldn't be found, as it no longer has the jpg file extension. However when the picture is "called" in the Gallery, the system would know to temporarilly rename the file back to "airplane.jpg" for it to be recognised by the web browser.

Just an idea. I have no idea if it is actually possible as I am not a PHP programmer, but as I always say, the stupidest suggestion is the one that never gets made.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: shef on January 18, 2007, 08:31:03 pm
Side-note: I have tested the mod in FF2, IE6 and Opera8.
Joachim

I can't get it to work in FF, is there anything I might be doing wrong?  It works fine in IE7
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Joachim Müller on January 19, 2007, 08:13:23 am
Impossible to say without a link to your site...
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: shef on January 20, 2007, 01:38:34 pm
oh, sorry,

www.shefdomi.com/gallery
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: shef on January 27, 2007, 09:40:16 pm
Anyone able to help?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on January 28, 2007, 02:22:26 pm
bump this thread when your site is online again
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: shef on February 03, 2007, 06:59:36 pm
bump - it's back online now
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: kiig on February 05, 2007, 12:21:27 pm
I had weird issues with some of my albums showing images correctly (after applying the functions) and other not showing the images.

Took me a while to figure out that

Code: [Select]
$imginfo=getimagesize($picture_url);
should be replaced by

Code: [Select]
$imginfo=getimagesize(urldecode($picture_url));
Don't know if that helps, - made a world of difference to me :-)

thanx.

Kim.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on February 05, 2007, 03:54:55 pm
bump - it's back online now

can't check cause it doesn't seem you have the mod running
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Fudgemaster on March 12, 2007, 02:31:51 pm
I've noticed that some users, mainly firefox, have been having trouble seeing .swf
files when this overlay hack has been applied to the theme in use.

Removing it or using a non hacked theme shows the .swf files perfectly,
but with the hack, only a blank white screen will show up.
Plugins/players are installed so the .swf itself works perfectly.

I really wouldn't like to remove that overlay from use just
because of one album having .swf in it.

some item from the album:
http://www.partanen.net/gallery/displayimage.php?pos=-24363
straight url to file itself:
http://www.partanen.net/gallery/albums/friday/003.swf
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Apurbo on March 25, 2007, 02:30:24 pm
Thanx for This Nice Hack. I have successfully install it at http://apurbo.com . I cant understand how i can allow unregistered member to view photo ( Now, unregistered member can see a white screen rather than photo). I badly need the ans. I just need to protect download or save as Photo and want everybody even Guest can view All photo. I am a new wibe. Pls Help me..
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on March 25, 2007, 02:45:58 pm
looks like you've installed some plugin that interfers with this mod
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: cgc0202 on March 26, 2007, 03:07:07 am
<b>Transparent gif overlay  mod and the CPMFetch mod</b>

I wanted to try this mod but the only issue is that it may mess up other mods.

For example, many of my existing galleries are displayed in other sites using the CPMFetch mod.  Briefly, this involves the  CPMFetch "interacting" with the images in the CPG database so that they are presented as screen viewable images in other pages.

In the aforementioned CPMFetch display procedure, is the process considered a "download" and thus, not allowed? 

I cannot try this simply because my photos are centralized and used by multiple galleries and in turn the multiple galleries are used by the  CPMFetch to integrate images in "gazillion" pages now.

Cornelio
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on March 26, 2007, 07:26:44 am
not the fullsize access control plugin ?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Apurbo on March 27, 2007, 09:25:44 am
looks like you've installed some plugin that interfers with this mod

I just Use Full access control and Shoping busket mod. Pls Help me How i allow guest to view images?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on March 27, 2007, 10:52:01 am
as said, the full size access control plugin interfers with this very mod. I never looked into the plugin you use so I can't tell you how to modify either the plugin or this mod to make them both work together.

As far as I can see the plugin grabs and modifies the html output (after this mod created it). Therefore the transparent overlay.gif is present but not the image itself in the table background. --> look up the part of the plugin code responsible for this and tell it not to remove the table setup with the image in the bg
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: cgc0202 on March 27, 2007, 01:45:15 pm
Hi Stramm,

I tried the mod in one of my test galleries.  It worked but when you click on the thumbnail, it displays the full size image rather than the intermediate image..


To test this, I pasted the overlay text only on the theme.php of the "Supernova" theme but not in the others.

Here are some details:

PhotoGallery (http://likas-philippines.org/gal004/)
vVPG1410-Strammmodpack

Please view the Classic (the themes options are at the bottom of the page) and click on one of the thumbnails.  Note that the intermediate and full size shows up; and neither are protected in the "Classic" theme.  If you now switch to the Supernova, a protected theme,   and then click on a thumbnail, the fullsize (and not the intermediate) image shows on the browser and  the popup.  The bright note is that the "overlay.gif" protection did work.

Cornelio
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on March 27, 2007, 04:58:27 pm
use the version for the modpack
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: cgc0202 on March 27, 2007, 07:41:52 pm
use the version for the modpack

Can you please elaborate what you mean by the aforementioned statement, Stramm. 

I used the latest Stramm modpack that was intended to be used for CPG 1.4.10 and I downloaded the "overlay.zip" and the "overlay.gif" from the downloads in the original post of this thread:

http://forum.coppermine-gallery.net/index.php?topic=33782.0

There is a note in the aforementioned thread that states:

"the modpack version can be found here
http://forum.coppermine-gallery.net/index.php?topic=32548.0"

but th title of the seconf link is:

"Modpack addition - prevent right click save as"

and the downloadable stuff there are the "overlay.gif"  and a "theme.zip"

Based on the title of the second thread, if I use the modified  "theme.php" does this prevent a "right click save as" also as well as "Prevent downloading of pics - transparent gif overlay"?

Many people do not like messing up with the "right click save as" feature, and I would be mad too, if someone did that -- so I do not want to include the  "prevent a "right click save as""

So, I am confused what exactly did you mean when you stated:

use the version for the modpack

Please clarify.  Thanks.

Cornelio
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on March 27, 2007, 07:47:05 pm
http://forum.coppermine-gallery.net/index.php?topic=32548.0
that's the version for the modpack... I told you cause you posted in the overlay mod thread for 'unmodded' CPGs

prevent right click save as means... a not very experienced user will not be able to download the pic cause he'll download the overlay image. I do not like blocking the right mouse button, therefore this mod got written
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: cgc0202 on March 27, 2007, 09:07:13 pm
Hi Stramm:

1.  I also want this mod: "Prevent downloading of pics - transparent gif overlay" not the "prvent right click..." so we agree pm that

2. In my post yesterday (http://forum.coppermine-gallery.net/index.php?topic=33782.msg202110#msg202110): I stated that  the "Prevent downloading of pics - transparent gif overlay" worked a-- s demonstrated in the Supernova theme, please click this example (http://likas-philippines.org/gal004/displayimage.php?album=random&cat=0&pos=-34), and select the Supernova theme (at the bottom) for the demo.  [I have not modified the other themes yet, that is the only reason why  it does not work in th eother them choices, at the moment.]

If you try to download the image, it will show the overlay.gif, as expected. Good so far. And, that is what I want.

3.  Just one "significant problem", if you please click this example (http://likas-philippines.org/gal004/displayimage.php?album=random&cat=0&pos=-34), in the Supernova theme (see note above), it is not the "intermediate image that is showing but the full size image"

4. Questions:
How come this mod, messed up the showing of the "intermediate size image" when you click on the thumbnail?
Is there anything I can change in the script, so that the "intermediate size image" will show when the thumbnail is clicked? And, subsequently for the full size image to show -- when accessed through the intermediate --  but not downloadable.

I must emphasize that the the mode you created, does prevent the download of the full size image already.  The only issue right now is: Why did it mess up the showing of the intermediate size image when clicking thumbnal? If that issue is resolved, then the mod would be useful for the purpose.

I might not have explained  myself clearly  in my post yesterday (http://forum.coppermine-gallery.net/index.php?topic=33782.msg202110#msg202110): It works with he Supernova only -- for now -- because that is the only theme where I included this mod, so far.  I can make it work in the other  themes also, if I place the mod in  them  too.  The only reason why I did not do that yet is because pf the problem with the "intermediate size image" not showing as expected, when this mod was introduced.


I am not entirely clear what you meant below that my set up is an "unmodded' CPGs".  I am using your Stramm modpack for the CPGv1.4.10. If my setup is an "unmodded (???) CPG", what do I need to include to make it a "modded  CPG"? 

Whatever it is that should be included --to make it a "modded  CPG"?-- it must not introduce the "prevent right click save as...".  We both agree on that, as you stated:


http://forum.coppermine-gallery.net/index.php?topic=32548.0
that's the version for the modpack... I told you cause you posted in the overlay mod thread for 'unmodded' CPGs

prevent right click save as means... a not very experienced user will not be able to download the pic cause he'll download the overlay image. I do not like blocking the right mouse button, therefore this mod got written

It is really critical that I make this work.  More people might be more willing to share their photos in our collaborative photogallery, if the mod presented here will work.  It is essentially the only "anti-theft" measure incorporated by Flickr.


To be frank, I already know how to go around this mod, to download the original image. But, if it will reassure people, then it is worth including.

For now, I just hope you can help me  make it work.  Thanks.

Cornelio
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on March 27, 2007, 09:12:18 pm
You have a CPG with the modpack -> use the overlay mod that has been coded for use with the modpack CPG
If you use the overly mod for an 'unmodded' CPG together with the modpack CPG it gives problems.

That's the reason why there are versions for a standard and the modpack CPG. Now please do as suggested and visit the other thread I refered you to (in the first and the last post of this thread)
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: tibu on March 30, 2007, 03:52:30 pm
Great mod, thanks. Is there a version forthcoming that would download overlay.gif from the slideshow?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on March 30, 2007, 05:31:19 pm
ouch, yo, I always forget about the slideshow (cause I du not use it)... hmm
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: gsrstudio on April 16, 2007, 10:04:59 pm
Could you help me to modify my them?
I don't know where exactly to add overlay text.
Do I need to add overlay image only in root directory?
Please find attached my them.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on April 16, 2007, 10:22:50 pm
Have you read the first post of this thread? It tells you how to install this mod.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: sascham on June 03, 2007, 09:21:54 pm
Hi!
This mod sounds very cool, but i have some problems to
include this mod into the 'Water Drop' theme.....

Can someone include this mod into the 'Water drop' theme.php
for me?

That would be very very nice!!!

Thank you!

Greetings Sascha
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on June 03, 2007, 09:48:21 pm
Do exactly as said in the first post of this thread. No special requirements or instructions for the water drop theme.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: sascham on June 03, 2007, 10:03:11 pm
Hi!

I didt it like in the first post, but i'm such a newbie, that it doesn't work  :-[

Can someone help me please ..?

Thank u very much!

Greetings Sascha
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Joachim Müller on June 05, 2007, 07:24:14 pm
We don't mind if people don't understand things in the first place and post questions. However, we have little tolerance for laziness. Therefor, just posting that it "didn't work" and asking to be spoon-fed and have the files modified for you is not what will make supporters more willing to help you. Post what you did (the modifications you have made - zip them and attach them to your posting) and what error message you get. Posting a link to your gallery is almost mandatory.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Terror on July 03, 2007, 01:41:17 am
hi,

at first this is a great mod. is it possible to make it compatible with the HighSlide plugin 2.2 By BMossavari?

greets
terror
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Veronica on July 09, 2007, 12:14:25 am
I have installed the zip file and I had only one problem after installation
with picture files with names like this filename:

normal_Qx%20crop%20resize%20of%20PB234760.jpg

which I solved by adding urldecode to the two getimagesize calls from the zip file ie

$imginfo=getimagesize(urldecode($picture_url));
$imagesize = @getimagesize(urldecode($picname));

where the first one solved the bug of getting no picture above the filmstrip in displayimage.php
I added the second one just in case being needed
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: yash on July 17, 2007, 08:55:12 pm
Hello,
Thanks for this mod really helpful.
But the problem is that in firefox it loads only a blank player, the movie is not loaded. Can anyone solve this?

Thanks
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on July 18, 2007, 08:16:32 am
to include the latest changes for that function that have been made in the orig CPG you'll have to search
Code: [Select]
                                'clsid' => 'classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" ',
and replace with
Code: [Select]
                                'clsid' => 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ',


and
Code: [Select]
        $pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';replace with
Code: [Select]
        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';

That function doesn't do anything if a movie gets displayed. So the best start to troubleshoot would be to remove the entire mod from your theme.php and see if it works without (unmodded CPG).
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: yazeft on July 23, 2007, 01:44:28 pm
I've made the changes and this is an awesome feature to have! It's great and better than the 'no right click' crap!

just a thing, i've realised that the display image page loads and is completed but the actual picture takes a while before it is displayed! hmmm.. i'm using mozilla firefox and it says 'done' in the status yet everything has loaded except the photo, then after a while it just appears..

is there a way perhaps we can have a 'loading' gif that just displays a loading icon before the image is displayed, at least it shows the user that the picture is coming...

is this possible?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on July 23, 2007, 02:21:17 pm
Probably possible but I haven't looked into this so far.

You'd have to use JavaScript, eg.
http://www.dynamicdrive.com/dynamicindex4/preloadimage2.htm

May work if the JavaScript is pasted into displayimage.php (function theme_html_picture() -> var $pic_html). Then displayimage.php could give over the filename/url to the JavaScript. However that won't be proper html syntaxwise.

Maybe I give it a try somewhen.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: yazeft on July 23, 2007, 02:28:43 pm
hey! that's exactly what i'm looking for!!

thanks for pointing that out... i'm not too good with the coding, could you please help me out with it?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on July 23, 2007, 02:34:27 pm
Maybe I give it a try somewhen.

Atm I've got lots to do offline. If I find a free min ...
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: yazeft on July 23, 2007, 02:39:25 pm
thanks stramm! i sure will keep an eye on this and wait patiently for your updates..
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on July 24, 2007, 07:24:53 pm
if you want to display an 'image loading' message as requested from yazeft, then replace your function theme_html_picture() with the one below. Check the code, especially the JavaScript part to change color and location of the message.
The JavaScript is included into the html body. So it's not transitional.
It should work but I wasn't able to test it (cause I only have modpack CPGs installed on my boxes)

this mod has been requested here
http://forum.coppermine-gallery.net/index.php?topic=33782.msg216615#msg216615


Code: [Select]
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
    global $album, $comment_date_fmt, $template_display_media;
    global $lang_display_image_php, $lang_picinfo;

    $pid = $CURRENT_PIC_DATA['pid'];
    $pic_title = '';

    if (!isset($USER['liv']) || !is_array($USER['liv'])) {
        $USER['liv'] = array();
    }
    // Add 1 to hit counter
    if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

    if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }else{
     $condition = false;
    }

    if ($CURRENT_PIC_DATA['title'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if ($CURRENT_PIC_DATA['caption'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if ($CURRENT_PIC_DATA['keywords'] != '') {
        $pic_title .= $lang_picinfo['Keywords'] . ": " . $CURRENT_PIC_DATA['keywords'];
    }

    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }

    $CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }

    $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    $pic_title = '';
    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);


    if ($mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
            $CURRENT_PIC_DATA['pwidth']  = 320; // Default width

            // Set default height; if file is a movie
            if ($mime_content['content']=='movie') {
                $CURRENT_PIC_DATA['pheight'] = 240; // Default height
            }
        }

        $ctrl_offset['mov']=15;
        $ctrl_offset['wmv']=45;
        $ctrl_offset['swf']=0;
        $ctrl_offset['rm']=0;
        $ctrl_offset_default=45;
        $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
$imginfo=getimagesize($picture_url);
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
$pic_html = "<table cellpadding=0 cellspacing=0><tr><td background=\"" . $picture_url . "\" width={$imginfo[0]} height={$imginfo[1]} class=\"image\">";
            $pic_html .= "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"images/overlay.gif\" width={$imginfo[0]} height={$imginfo[1]}  border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n </td></tr></table>";
        } else {
$pic_html = "<table cellpadding=0 cellspacing=0><tr><td background=\"" . $picture_url . "\" width={$CURRENT_PIC_DATA['pwidth']} height={$CURRENT_PIC_DATA['pheight']} class=\"image\">";
            $pic_html .= "<img src=\"images/overlay.gif\" width={$CURRENT_PIC_DATA['pwidth']} height={$CURRENT_PIC_DATA['pheight']} border=\"0\" alt=\"\" /><br />\n";
            $pic_html .= "</td></tr></table>";
}
$pic_html .=  <<<EOT
<script type="text/javascript" language="javascript">
<!--
// Progressbar - Version 2.0
// Author: Brian Gosselin of http://scriptasylum.com
// Featured on Dynamic Drive (http://www.dynamicdrive.com)
// PUT THE NAMES OF ALL YOUR IMAGES THAT NEED TO BE "CACHED" IN THE "imagenames" ARRAY.
// DONT FORGET THE COMMA BETWEEN EACH ENTRY, OR THE TICK MARKS AROUND EACH NAME.
// WHEN ALL THE IMAGES ARE DONE LOADING, THE "imagesdone" VARIABLE IS SET TO "TRUE"

var imagenames=new Array( '{$picture_url}');

var yposition=400;                                  //POSITION OF LOAD BAR FROM TOP OF WINDOW, IN PIXELS
var loadedcolor='gray' ;                // PROGRESS BAR COLOR
var unloadedcolor='white';                   // BGCOLOR OF UNLOADED AREA
var barheight=25;                                 // HEIGHT OF PROGRESS BAR IN PIXELS (MIN 25)
var barwidth=350;                                // WIDTH OF THE BAR IN PIXELS
var bordercolor='black';                       // COLOR OF THE BORDER

//DO NOT EDIT BEYOND THIS POINT
var NS4 = (navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5)? true : false;
var IE4 = (document.all)? true : false;
var NS6 = (parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var imagesdone=false;
var blocksize=barwidth/(imagenames.length);
barheight=Math.max(barheight,25);
var loaded=0, perouter, perdone, images=new Array();
var txt=(NS4)?'<layer name="perouter" bgcolor="'+bordercolor+'" visibility="hide">' : '<div id="perouter" style="position:absolute; visibility:hidden; background-color:'+bordercolor+'">';
txt+='<table cellpadding="0" cellspacing="1" border="0"><tr><td width="'+barwidth+'" height="'+barheight+'" valign="center">';
if(NS4)txt+='<ilayer width="100%" height="100%"><layer width="100%" height="100%" bgcolor="'+unloadedcolor+'" top="0" left="0">';
txt+='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="center" width="'+barwidth+'" height="'+barheight+'" bgcolor="'+unloadedcolor+'"><center><font color="'+loadedcolor+'" size="1" face="sans-serif">Loading Images...</font></center></td></tr></table>';
if(NS4) txt+='</layer>';
txt+=(NS4)? '<layer name="perdone" width="100%" height="'+barheight+'" bgcolor="'+loadedcolor+'" top="0" left="0">' : '<div id="perdone" style="position:absolute; top:1px; left:1px; width:'+barwidth+'px; height:'+barheight+'px; background-color:'+loadedcolor+'; z-index:100">';
txt+='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="center" width="'+barwidth+'" height="'+barheight+'" bgcolor="'+loadedcolor+'"><center><font color="'+unloadedcolor+'" size="1" face="sans-serif">Loading Images...</font></center></td></tr></table>';
txt+=(NS4)? '</layer></ilayer>' : '</div>';
txt+='</td></tr></table>';
txt+=(NS4)?'</layer>' : '</div>';
document.write(txt);
function loadimages(){
if(NS4){
perouter=document.perouter;
perdone=document.perouter.document.layers[0].document.perdone;
}
if(NS6){
perouter=document.getElementById('perouter');
perdone=document.getElementById('perdone');
}
if(IE4){
perouter=document.all.perouter;
perdone=document.all.perdone;
}
cliplayer(perdone,0,0,barheight,0);
window.onresize=setouterpos;
setouterpos();
for(n=0;n<imagenames.length;n++){
images[n]=new Image();
images[n].src=imagenames[n];
setTimeout('checkload('+n+')' ,n*100);
}}
function setouterpos(){
var ww=(IE4)? document.body.clientWidth : window.innerWidth;
var x=(ww-barwidth)/2;
if(NS4){
perouter.moveTo(x,yposition);
perouter.visibility="show";
}
if(IE4||NS6){
perouter.style.left=x+'px';
perouter.style.top=yposition+'px';
perouter.style.visibility="visible";
}}
function dispbars(){
loaded++;
cliplayer(perdone, 0, blocksize*loaded, barheight, 0);
if(loaded>=imagenames.length)setTimeout('hideperouter()', 800);
}
function checkload(index){
(images[index].complete)? dispbars() : setTimeout('checkload('+index+')', 100);
}
function hideperouter(){
(NS4)? perouter.visibility="hide" : perouter.style.visibility="hidden";
imagesdone=true;
}
function cliplayer(layer, ct, cr, cb, cl){
if(NS4){
layer.clip.left=cl;
layer.clip.top=ct;
layer.clip.right=cr;
layer.clip.bottom=cb;
}
if(IE4||NS6)layer.style.clip='rect('+ct+' '+cr+' '+cb+' '+cl+')';
}
window.onload=loadimages;
-->
</script>
EOT;
    } elseif ($mime_content['content']=='document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        $autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        $players['WMP'] = array('id' => 'MediaPlayer',
                                'clsid' => 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ',
'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                'mime' => 'type="application/x-mplayer2" ',
                               );
        $players['RMP'] = array('id' => 'RealPlayer',
                                'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                'codebase' => '',
                                'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               );
        $players['QT']  = array('id' => 'QuickTime',
                                'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                'mime' => 'type="video/x-quicktime" '
                               );
        $players['SWF'] = array('id' => 'SWFlash',
                                'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                'mime' => 'type="application/x-shockwave-flash" '
                               );
        $players['UNK'] = array('id' => 'DefaultPlayer',
                                'clsid' => '',
                                'codebase' => '',
                                'mime' => ''
                               );

        if (isset($_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            $user_player = $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            $user_player = $mime_content['player'];
        }

                // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

        $player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
$pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }

    $CURRENT_PIC_DATA['html'] = $pic_html;
    $CURRENT_PIC_DATA['header'] = '';
    $CURRENT_PIC_DATA['footer'] = '';

    $CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return template_eval($template_display_media, $params);
}
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: yazeft on July 26, 2007, 04:27:26 am
hi i've done that, it great but just needs a few tweaks..

i couldn't find the function in 'displayimage.php' but i found in 'theme.php' so i replaced that one (is that still the same?)

after applying this mod, i realised that it doesnt show the "unloaded" (white) bar just the 'loaded' (grey) one... so the user still waits, and when the pic is loaded then it displays the 'loaded' bar for a sec.. hmm?

also in mozilla firefox when you've displayed a pic and when you change tabs and come back to it, it shows the loading bar again... and doesnt go away!..
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on July 27, 2007, 08:50:45 am
displayimage.php??? No! You just replace the function theme_html_picture() from the zip in the first post with the one from my last post.
I've implemented that Javascript function but I did not / do not check that code if it works. On my local testbed all is OK, on my demo site the loading box does not show...

can't tell you much more, except that firefox doesn't make any problems and that I can't replicate your symptoms.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: dke on September 21, 2007, 09:28:24 pm
awesome mod, thanks!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: dke on September 22, 2007, 12:35:33 am
displayimage.php??? No! You just replace the function theme_html_picture() from the zip in the first post with the one from my last post.
I've implemented that Javascript function but I did not / do not check that code if it works. On my local testbed all is OK, on my demo site the loading box does not show...

can't tell you much more, except that firefox doesn't make any problems and that I can't replicate your symptoms.

I think what he wants is it to display this message also when clicking the image to get the full-size version.. I have the same issue as him, though it dosn't take so long for my image to load, but for modem users they might think the site is down or something cause its not displaying the picture untill the whole thing is loaded.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Aurra on September 29, 2007, 03:29:03 pm
Hi,
I use the waterdrop style.
There is a little problem with the _normal size picture i see only the overlay .gif.
For the full pictore it works fine.

Any idea what could be wring?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Aurra on September 29, 2007, 03:42:45 pm
ouch i forget the theme.zip  :)

the zip is with the theme.php and a example.php how it looks like...

p.s.
sorry for the double post but i wasnt able to find a edit button.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: disposition on November 14, 2007, 03:26:48 am
HI,

I tried this mod and itr works great but If you look at any of my pictures there is a broken link picture in the left corners of the pics.  Hope you can help me figure why it does this.

Thanks!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: disposition on November 14, 2007, 03:31:28 am
I didn't post my web address...    www.blackdeathmetal.com
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: disposition on November 14, 2007, 04:10:18 am
I got it, I put the gif in the theme images when I should of added it to the first folder of images.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: disposition on November 14, 2007, 04:12:00 am
I read through these post and am wondering if there was a way to get swf files not to show up white with this mod.  If there is a way please let me know.

www.blackdeathmetal.com
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Fudgemaster on December 02, 2007, 10:27:32 pm
Anyone had anyideas concerning the problem i described in a post in this thread?
http://forum.coppermine-gallery.net/index.php?topic=33782.msg199923#msg199923

Just updated to 1.4.14 coppermine
running the following mods:
CAPTCHA (http://forum.coppermine-gallery.net/index.php?topic=29564.0)
time&date stamp (http://forum.coppermine-gallery.net/index.php?topic=44280.0)

Opera, IE, and others seem to work but stil problems with Firefox 2.0.0.11 and even the 3.0b1

Gallery url is www.partanen.net/gallery
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on December 02, 2007, 10:59:23 pm
probably problems possible... I've seen your posting but unfortunately forgotten about it. Will try this the next time (I do not use flash... so that's not tested)
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: bradenkeith on December 14, 2007, 12:51:16 am
very easy install... i like it alot. thanks
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Hayvosh on December 29, 2007, 12:57:51 pm
Is there a way to implement this in 1.4.14? Since the theme.php (Theme Hardwired), looks different from the code to be replaced in the txt file here.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on December 29, 2007, 01:03:37 pm
You're supposed to copy/ paste (not replace) the contents of the txt file into your theme.php. Only if the in the first post mentioned functions are already in your theme.php ask here again what to do.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Hayvosh on December 29, 2007, 01:22:09 pm
The current theme.php I have looks like this from function_theme_html_picture:

So should I add something and where in that case? Since this code is more or less untouched as far as I know.

Code: [Select]
// Displays a picture
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
    global $album, $comment_date_fmt, $template_display_media;
    global $lang_display_image_php, $lang_picinfo;

    $pid = $CURRENT_PIC_DATA['pid'];
    $pic_title = '';

    if (!isset($USER['liv']) || !is_array($USER['liv'])) {
        $USER['liv'] = array();
    }
    // Add 1 to hit counter
    if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

    if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }else{
     $condition = false;
    }

    if ($CURRENT_PIC_DATA['title'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if ($CURRENT_PIC_DATA['caption'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if ($CURRENT_PIC_DATA['keywords'] != '') {
        $pic_title .= $lang_picinfo['Keywords'] . ": " . $CURRENT_PIC_DATA['keywords'];
    }

    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }

    $CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }

    $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    $pic_title = '';
    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);


    if ($mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
            $CURRENT_PIC_DATA['pwidth']  = 320; // Default width

            // Set default height; if file is a movie
            if ($mime_content['content']=='movie') {
                $CURRENT_PIC_DATA['pheight'] = 240; // Default height
            }
        }

        $ctrl_offset['mov']=15;
        $ctrl_offset['wmv']=45;
        $ctrl_offset['swf']=0;
        $ctrl_offset['rm']=0;
        $ctrl_offset_default=45;
        $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
        $picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        $pic_title = $CURRENT_PIC_DATA['title'];
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$pic_title\">";
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
    } elseif ($mime_content['content']=='document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        $autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        $players['WMP'] = array('id' => 'MediaPlayer',
                                'clsid' => 'classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" ',
                                'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                'mime' => 'type="application/x-mplayer2" ',
                               );
        $players['RMP'] = array('id' => 'RealPlayer',
                                'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                'codebase' => '',
                                'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               );
        $players['QT']  = array('id' => 'QuickTime',
                                'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                'mime' => 'type="video/x-quicktime" '
                               );
        $players['SWF'] = array('id' => 'SWFlash',
                                'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                'mime' => 'type="application/x-shockwave-flash" '
                               );
        $players['UNK'] = array('id' => 'DefaultPlayer',
                                'clsid' => '',
                                'codebase' => '',
                                'mime' => ''
                               );

        if (isset($_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            $user_player = $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            $user_player = $mime_content['player'];
        }

                // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

        $player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }

    $CURRENT_PIC_DATA['html'] = $pic_html;
    $CURRENT_PIC_DATA['header'] = '';
    $CURRENT_PIC_DATA['footer'] = '';

    $CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return template_eval($template_display_media, $params);
}

?>
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on December 29, 2007, 01:36:46 pm
The hardwired theme.php doesn't contain any of the functions this modification uses. So it's save to paste the contents of the txt file into your hardwired theme.php (right before the closing ?> ) - as described in the first post.

If your theme.php contains the mentioned functions it's already modded. In that case zip your theme.php and attach it to your next post.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Hayvosh on December 29, 2007, 02:02:05 pm
Here's my theme.php zipped.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on December 29, 2007, 02:17:26 pm
You have a modded function theme_html_picture... looks like a lightbox addition.

As I don't us such a mod I can't help you that much here. But with a diff viewer like winmerge you can compare the code of this mod with the original code and the lightbox code. Then it should be possible (with some try and fail) to merge everything.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: knaphih on February 15, 2008, 04:08:49 pm
the theme I'm using doesn't have 'function theme_display_fullsize_pic' or 'function theme_html_picture'.... and when i put the code in theme.php... intermediate images become unclickable.... anyway to fix this? or am i doing something wrong?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on February 15, 2008, 05:32:44 pm
post a link to your site and zip your theme.php and attach it to your next post
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: knaphih on February 16, 2008, 05:41:36 am
Here u go Stramm ... its www.fotodeck.com/gallery [Edit GauGau] Warning: link not safe for work [/Edit]

Ive attached the zipped theme.php.....
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on February 16, 2008, 08:29:42 am
of course a usr/ pass with permissions to at least view images would be useful.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: knaphih on February 16, 2008, 08:57:32 am
user: tempo
pass: 123456
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on February 16, 2008, 09:18:53 am
The mod isn't running on your site, therfore I can't see any issues... what should I advise you?
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: knaphih on February 16, 2008, 09:33:02 am
I was if you could put in the code for me....anyways.... ive installed the code....n its running.... i cant even view the intermediate images now... :( ... i have attached the theme.php file
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on February 16, 2008, 09:54:42 am
For me it works (both with ie7 and firefox). Maybe you have installed other mods/ plugins that prevent you (as admin) to open the fullsized image.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: knaphih on February 16, 2008, 10:06:40 am
i don knw.... somehow its working for me too now..... :)....cool mod btw....thnx... :D :D
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Joachim Müller on February 16, 2008, 02:39:37 pm
@knaphih: you're hiding the "Powered by Coppermine" tag. Restore it immediately!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: noviar on March 29, 2008, 04:50:03 am
Hallo stramm

I'm a newbie and don't know any knowledge about php. I tried to put your code by trial and error, because I don't know where to put your code.

I have some questions to ask do you mind?

first, could you teach me one more time, in what folder and file should I put your code to make overlay works?

then, when user try to click the intermediate picture, full size picture appears and if user try to save the picture, they will get overlay.gif, but If user maximizes the window, the overlay just cover some part of the picture, not the entire picture, If they move the cursor closer to right, they will be able to save the image. there is litle line that show the border between the overlay and the real image.


please help me with your tutor for dummy

thanks stramm
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: traypup on June 13, 2008, 12:51:58 am
Thank you --- this worked great on the first try. I appreciate it!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: SIM-R on June 13, 2008, 03:51:39 am
Ok - I know the moderators will behead me for this ......but at this point ...

I really like the idea of this mod . I love cpg but if I can't get this to work I may have to switch to some lame flash based gallery.....ugh .
I spent a few hours trying to figure this out . I'm using eyeball theme on the latest version which was installed server side .

I came to this post from strams previous post regarding this subject where it provided a link to the files . That link brought me here .
I click on the link on the first post here and I'm brought back there . I went to strams website and downloaded the modpack and can not seem to find the invisible gif mod within .
I don't need the rest of his mods  just the inv gif mod ( excellent and well thought out as they are  - thanks for the hard work in helping codeless hacks like myself ).
I have scoured the web, the forum and my limited brain trying to find out how to get these files . I saw that this option was to be include in future updates and indeed when reading the instructions for older versions it seems it was there . But not now ?It still works with 4.18??

Can someone please give me a link to download the two pieces of code and the gif . I saw mention of the zipped files but no download link .
I can then put the files and code in  the appropriate places .

Am I even CLOSE to solving this ?

Apologies all round for failure and needing of hand holding .
 Am I even CLOSE to solving this ?.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Stramm on June 13, 2008, 08:04:26 am
Code and gif are attached to the first post of this thread.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: SIM-R on June 13, 2008, 06:52:34 pm
Ok - now I know I am mentally challenged . :)

Sorry Stramm - I had been to the post and did not see it .
I did not know I had to be logged in to see the attachment . :-[
Could have saved hours of lameness ........

Makes sense now I think of it .

Thanks a million  ;)




Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: ohyoukrissie on June 29, 2008, 02:52:43 am
I'm a total newbie at modifying this code, and I've attempted it twice and keep getting syntax errors. I'm not entirely sure I've put the code in the correct place.

This is the error I got the second time :
"Parse error: syntax error, unexpected $end in /home/rachrorg/public_html/gallery/themes/Rachel/theme.php on line 2665"

My theme is located at www.rachel-tucker.org/gallery/themes/Rachel/theme.php

Hopefully someone can point me in the right direction!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: nyfalls on December 23, 2008, 04:08:26 am
First of all, I love this mod.  Thank you!   ;D
Without it my users would not use my gallery (copyright freaks)
I'm a newb and I installed it the first time without problems.
I disabled the full size image with a simple javascript/void- my users don't need to see it.
I do have some requests to help close some (newb) security holes- perhaps it would be easy to apply this mod to these cases (?):
The slideshow and the e-card- you can still right-click and save as the image. Can a variation of this code be applied to those?

Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: wpamungkas on February 24, 2009, 02:03:18 pm

I have the following message with installing the file to theme.php. Can help?

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /hermes/bosweb/web056/b565/sl.iaspemne/public_html/yudcom/fotos/themes/rainy_day/theme.php on line 54
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Joachim Müller on February 26, 2009, 09:07:53 am
Then undo and apply exactly as suggested. The message you got is simply a syntax error and shows that you haven't followed instructions to a tee.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Aurra on March 17, 2009, 10:45:56 pm
I have still a problem with it.
The normal and full size fotos are not shown.
There is only a white square with a black dot/square in the middle.

i use a changed water_drop theme.
You can find it here http://www.kromfohrlaender-fotos.de
Now i use the normale theme.php again.

It would be nice to have a litte chance to prefent newbs from right clicking...

Here is the theme.php with the change:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2007 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.12
  $Source$
  $Revision: 3636 $
  $Author: gaugau $
  $Date: 2007-06-29 11:35:30 +0200 (Fr, 29 Jun 2007) $
**********************************************/

define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until
                                           // you have validated it. See docs/theme.htm.

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='<img src="themes/water_drop/images/orange_carret.gif" width="23" height="12" border="0" alt="" />';

function 
theme_html_picture()
{
    global 
$CONFIG$CURRENT_PIC_DATA$CURRENT_ALBUM_DATA$USER;
    global 
$album$comment_date_fmt$template_display_media;
    global 
$lang_display_image_php$lang_picinfo;

    
$pid $CURRENT_PIC_DATA['pid'];
    
$pic_title '';

    if (!isset(
$USER['liv']) || !is_array($USER['liv'])) {
        
$USER['liv'] = array();
    }
    
// Add 1 to hit counter
    
if (!USER_IS_ADMIN && !in_array($pid$USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        
add_hit($pid);
        if (
count($USER['liv']) > 4array_shift($USER['liv']);
        
array_push($USER['liv'], $pid);
    }

    if(
$CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      
$condition true;
    }elseif(
$CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      
$condition true;
    }elseif(
$CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      
$condition true;
    }else{
     
$condition false;
    }

    if (
$CURRENT_PIC_DATA['title'] != '') {
        
$pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if (
$CURRENT_PIC_DATA['caption'] != '') {
        
$pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if (
$CURRENT_PIC_DATA['keywords'] != '') {
        
$pic_title .= $lang_picinfo['Keywords'] . ": " $CURRENT_PIC_DATA['keywords'];
    }

    if (!
$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        
template_extract_block($template_display_media'img_desc');
    } else {
        if (!
$CURRENT_PIC_DATA['title']) {
            
template_extract_block($template_display_media'title');
        }
        if (!
$CURRENT_PIC_DATA['caption']) {
            
template_extract_block($template_display_media'caption');
        }
    }

    
$CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    
if ($CONFIG['make_intermediate'] && $condition ) {
        
$picture_url get_pic_url($CURRENT_PIC_DATA'normal');
    } else {
        
$picture_url get_pic_url($CURRENT_PIC_DATA'fullsize');
    }

    
$image_size compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    
$pic_title '';
    
$mime_content cpg_get_type($CURRENT_PIC_DATA['filename']);


    if (
$mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if (
$CURRENT_PIC_DATA['pwidth']==|| $CURRENT_PIC_DATA['pheight']==0) {
            
$CURRENT_PIC_DATA['pwidth']  = 320// Default width

            // Set default height; if file is a movie
            
if ($mime_content['content']=='movie') {
                
$CURRENT_PIC_DATA['pheight'] = 240// Default height
            
}
        }

        
$ctrl_offset['mov']=15;
        
$ctrl_offset['wmv']=45;
        
$ctrl_offset['swf']=0;
        
$ctrl_offset['rm']=0;
        
$ctrl_offset_default=45;
        
$ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        
$image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if (
$mime_content['content']=='image') {
        if (isset(
$image_size['reduced'])) {
$imginfo=getimagesize($picture_url);
            
$winsizeX $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            
$winsizeY $CURRENT_PIC_DATA['pheight']+3//the +'s are the mysterious FF and IE paddings
$pic_html "<table cellpadding=0 cellspacing=0><tr><td background=\"" $picture_url "\" width={$imginfo[0]} height={$imginfo[1]} class=\"image\">";
            
$pic_html .= "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            
$pic_title $lang_display_image_php['view_fs'] . "\n==============\n" $pic_title;
            
$pic_html .= "<img src=\"images/overlay.gif\" width={$imginfo[0]} height={$imginfo[1]}  border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            
$pic_html .= "</a>\n </td></tr></table>";
        } else {
$pic_html "<table cellpadding=0 cellspacing=0><tr><td background=\"" $picture_url "\" width={$CURRENT_PIC_DATA['pwidth']} height={$CURRENT_PIC_DATA['pheight']} class=\"image\">";
            
$pic_html .= "<img src=\"images/overlay.gif\" width={$CURRENT_PIC_DATA['pwidth']} height={$CURRENT_PIC_DATA['pheight']} border=\"0\" alt=\"\" /><br />\n";
            
$pic_html .= "</td></tr></table>";
}
    } elseif (
$mime_content['content']=='document') {
        
$pic_thumb_url get_pic_url($CURRENT_PIC_DATA,'thumb');
        
$pic_html "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        
$autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        
$players['WMP'] = array('id' => 'MediaPlayer',
                                
'clsid' => 'classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" ',
                                
'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                
'mime' => 'type="application/x-mplayer2" ',
                               );
        
$players['RMP'] = array('id' => 'RealPlayer',
                                
'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                
'codebase' => '',
                                
'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               
);
        
$players['QT']  = array('id' => 'QuickTime',
                                
'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                
'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                
'mime' => 'type="video/x-quicktime" '
                               
);
        
$players['SWF'] = array('id' => 'SWFlash',
                                
'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                
'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                
'mime' => 'type="application/x-shockwave-flash" '
                               
);
        
$players['UNK'] = array('id' => 'DefaultPlayer',
                                
'clsid' => '',
                                
'codebase' => '',
                                
'mime' => ''
                               
);

        if (isset(
$_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            
$user_player $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            
$user_player $mime_content['player'];
        }

                
// There isn't a player selected or user wants client-side control
        
if (!$user_player) {
            
$user_player 'UNK';
        }

        
$player $players[$user_player];

        
$pic_html  '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        
$pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\""$picture_url "\" />";
        
$pic_html .= '<embed '.$image_size['whole'].' src="'$picture_url '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        
$pic_html .= "</object><br />\n";
    }

    
$CURRENT_PIC_DATA['html'] = $pic_html;
    
$CURRENT_PIC_DATA['header'] = '';
    
$CURRENT_PIC_DATA['footer'] = '';

    
$CURRENT_PIC_DATA CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    
$params = array('{CELL_HEIGHT}' => '100',
        
'{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        
'{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        
'{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        
'{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return 
template_eval($template_display_media$params);
}

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_MODEcpg_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>
  <meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
  <title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
      
?>
</title>
  <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; <?php $imagedata['geometry'?> border-collapse:collapse}
  td {         vertical-align: middle; text-align:center; }
  </style>
  </head>
  <body>
    <script language="JavaScript" type="text/JavaScript">
      adjust_popup();
    </script>
    <table cellpadding="0" cellspacing="0" align="center">
      <tr>
              <?php     
   echo "<td align=\"center\" valign=\"middle\" background=\"" htmlspecialchars($imagedata['path']) . "\" {$imagedata['geometry']} class=\"image\">";
echo "<div id=\"content\">";
   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>
        </td>
      </tr>
    </table>
  </body>
</html>
<?php
}

?>

Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Joachim Müller on March 18, 2009, 09:13:08 am
It would be nice to have a litte chance to prefent newbs from right clicking...
Then use http://forum.coppermine-gallery.net/index.php/topic,33377.0.html
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Aurra on March 22, 2009, 12:37:45 pm
Hallo Joachim,

thank you very much for the fast reply!
That's a great plugin and exactly what my father wants for his site.
That will be stopping the one photo thief for sure.  Okay print SCRN will always working, but for some thausand of photos that's to much work... ;)
I hope the RC Option in 1.5 will be something like that.

Thanks!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Joachim Müller on March 23, 2009, 10:24:51 am
Hate to spoil the fun for you, but turning JavaScript off will do the trick as well for the thief. In fact, the thief can do a million other things to circumvent the no-right-click script and no doubt will. However, your posting doesn't belong in this thread, but in the other thread that I refered to: you talk about the right-click-prevention plugin inside the announcement thread of an unrelated mod. That's not a clever thing to do, so please respect common sense: if you have something to say about the no-right-click-plugin, do so on the proper thread.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Radek7 on April 01, 2009, 05:17:47 am
Hi,
  I am using your overlayhack and I just found little problem. If there is %20 in original image path, original image doesn't appear. I also use MassImport plug-in for creating categories and albums.
Is it limitation of hack or html code? And is there any way to modify this hack to work with %20 in file name?

                  Radek
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Radek7 on April 01, 2009, 04:20:52 pm
Hi,
  I just checked Auraa's website http://www.kromfohrlaender-fotos.de and his problem is also because '%20'. I his case in file names.

             Radek
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Nibbler on April 01, 2009, 04:53:53 pm
Read the thread. The solution has already been posted, twice in fact.
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Radek7 on April 03, 2009, 02:41:07 am
Thanks for note, I reread everything once more and found solution.

                Radek
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: Ann665 on April 17, 2009, 05:34:17 pm
thanks  getting closer :)
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: olousek on January 28, 2010, 10:48:34 pm
of course possible. Basically you compare the modified functions with the original ones. Copy the changes into the original function and pack them in a if/ else clause
if (!USER_ID){...}  //for the not logged in user

Hello, I'm newbie in PHP - I need to know how to include this change...

Thanks!
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: GrubbyGirl on January 28, 2010, 11:55:08 pm
Hi
I have tried this mod on the classic theme and it works a treat, however the theme I use on my gallery is chaoticsoul which already has the function theme_html_picture and function theme_display_fullsize_pic.  I would appreciate knowing if this mod can be applied to this template?  If so how can I do it?

My gallery is www.laurelhollomanonline.com/gallery  and I have attached the theme.php

I am a real newbie, but I am pretty good at following instructions  ;D

I hope you can help.

Thanks

Angela
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: olousek on January 31, 2010, 03:55:13 pm
Hello, Angela,

thank you!

I change my black_widdow theme by Stramm's instructions. And it works fine - for all visitors include ADMIN.

But I need to admin and defined groups can link and download photos.

I tried to make changes in accordance with your theme, but it doesn't work at all :-(

I attach theme.zip with Stramm's functions and theme1.zip with yours functions.

Is there anybody who can help me?

Thanks!

my gallery: http://www.PhotoWatches.eu (http://www.PhotoWatches.eu)
Title: Re: Prevent downloading of pics - transparent gif overlay
Post by: GrubbyGirl on January 31, 2010, 04:06:10 pm
I have actually changed my theme (modified foliage theme) and I did have one problem with some pictures not displying the intermediate and large size, but found a solution on this thread.  I like the chaotic soul theme so if this mod could be made to work with it, that would be wonderful!

Angela