Displaying Large Image Displaying Large Image
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Displaying Large Image

Started by Jarvhix, April 24, 2006, 11:47:51 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Jarvhix

I really do not want to use the (no-right-click) code because I do want to offer users the option to view and or save the photos. What I really don't want is for non-members to view the large pictures without being logged in. I know the url for an image will take a visitor directly to that image, but is there any possible way, that you all have a script that will only show the image, (even if the person typed in the exact url to the image), that the image will not display unless the user is logged in? Sounds impossible but I thought I'd try and ask about it.

Stramm

#1
copy from themes/sample/theme.php the function
theme_html_picture()
to the theme.php you're using.
Now find

            $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";


and replace with

            $pic_html = '';
if (USER_ID) $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            if (USER_ID) $pic_html .= "</a>\n";



haven't tested this cause it won't work with my modded version but should do with yours
of course this will not prevent users from typing in the URL directly in the browser. For that some more effort is necessary.
read http://forum.coppermine-gallery.net/index.php?topic=30738.0
to make it work for you, you won't set the cookie in scripts.js but only when a user's logged in

Jarvhix

Sweet! So am I assuming correctly, to copy the entire function for the function
theme_html_picture()


In other words, what's the last code to copy, staring with:


function theme_html_picture()?

I copied the code from:
function theme_html_picture(), all the way to:

return template_eval($template_display_media, $params);
}


is that and everything in bewteen go into the theme I am using Which is "Blachbirch"?


I checked the thread you posted here and I read it yesterday. I do currently already have an .htaccess file in the main root of my site's directory. Am I to add the script to the current .htaccess file or am I to start all over again? But isn't that only to keep people from hotlinking? Would it actually keep people from seeing the image when they type in the url, if they are not going to the image directly from my site?

I hope to to confuse you. I'm just a little wee bit confused. lol.

Stramm

you musn't post this in the doc root or in your coppermine root. That'll prevent coppermine or everything else to work for users without that cookie. You're supposed to put that htacces into the albums dir... still there's more code you need to add... as said, it won't do if add the javascript to scripts.js
you need to investigate coppemine code a lil bit and eg add that code when coppermine builds the menu and the user is logged in...

hmm... sorry, when thinking about that, this code will prevent any image (thumb, intermediate, fullsized) from displaying without beeing logged in.
-> you'd need to modify coppermine the way that it saves fullsized pics in a seperate dir

Try the $pic_html stuff, this will make the intermediate not clickable for not logged in users. Everything else is overkill and just the mentioned mod will block ~99% of 'not allowed access'

and yes, the entire function down to
       
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return template_eval($template_display_media, $params);
}

Jarvhix

Ok, thanks. I will add the function to the template. What exactly does the function do, when I copy and paste the code into the theme I am using? Ok, and the htaccess thing... if they are not logged in, they will not even see the thumbs because I already have it to where they have to be logged in to even view the albums. So, I don't mind if the thumbs etc.. don't show to non-logged in users. If they are not logged in, they should never know if thumbs are showing right?

Ok, help me out one more time with the htaccess thing. Post to me exactly what code I am to put in a htaccess file in the albums folder.


OR

Lets, say that, I want them to be able to right click and save... is there a way to remove the 'properties' off the right click. (like a customizable right-click)? I know there are some scripts out there but I don't want to screw things up. I made one mistake some days ago that it took all day to fix. :( but it's good now.


Which ever way is easier, I'll take it. :)

btw, thanks a lot for helping me out. I must seem a bit of a nag. :)

Stramm

I'm not a friend of the disable right click thing... so I can't help you to much with that. And as said I'd just start with the code I've given you. If you see (in your logs) that unregistered users open the fullsized, then you still can think about messing with htaccess

The code I gave you will show the fullsized popup only to registered users

Jarvhix

I added the code you gave me, but I was still of course, able to do what I was hoping not to be able to do. I guess I was really trying to avoid having users see where the image is located, because if they simply right click and either view the properties or the source, it will show the location of the image. I wanted them to be able to save but not actually view the location of the image so easily. *shrugs*

My site has some people there that I do not trust. Sadly. But if I have to convert back to no-right-click then I will do that (to avoid having members send the links to the large images to others that are not members.) I should think that if non-members can simply type in the url to the images, there really isn't too much a purpose of having a member's only gallery.*shrugs again*


Again, I do know that if someone really wanted to find the image location that they can find it in the temporary internet files... I just didn't want it to be so easy to find, especially with the album folders being 777 chmod. :(

shall I remove the code you gave me since it didn't work?

Stramm

the code's doing exactly what I told you, disabling fullsize popup for not registered users. If that's not useful for you.. yes, then remove it.

chmod 777 has nothing to do with the accessability of images for registered/ not registered users

of course you can hide the image location. However that's not done within a few mins. You can ask on the freelancers board.

If only registered members will see any image (thumb, normal, fullsized) you can consider the htaccess/ cookie route.

Jarvhix

Ok, I can deal with an extensive time on trying to hide the image location. I think it's worth it. Thansk a lot. Where can I find the mod that hides the location of the image for coppermine 1.4.5?

Jarvhix

I searched the board and for now, ...this will work until I can think of what to do. :)

Jarvhix

Hello. I've ran into a problem. I tried the .htaccess code from the link I posted above, and it didn't work. The images at the gallery were all redXs after I used the rewrite code. And I made sure it was written correctly (allowing my domain to display the images). So there were no problems there. So now I am left with the only choice of disabling the right click. Yes, I know it's silly and that people can really get the location if they wanted to (OR) new how to. But there are some that don't know that. I have over 2,000 images and only 10% or so watermarked already. I do not wish to remove them all and watermark and reload them. That's too much a hassle. I read about the watermark for each image load, but to my understanding, that uses up server space. So, I suppose there really is no way to keep people from typing in the url to the large image and seeing the large image without ever going to my site to log in. I've searched the board and only found one topic that mentioned putting the no-right-click in the (displayimage.php), but that was for the CPG 1.2 version I believe. Is there not a code for version 1.4.5 to add into the script.js file and/or the displayimage.php file?

Thanks for helping.
I'm frustrated.