forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Paver on December 12, 2005, 07:06:32 pm

Title: Full-Size & Intermediate Photos Access Control
Post by: Paver on December 12, 2005, 07:06:32 pm
Note: This post gives the most recent version of this plugin.  The original post that announced the first release of this plugin is provided below the version list.

This plugin allows you to control access to the full-size and intermediate photos/files by usergroup.  Versions 1.2 and earlier only control the full-size photo.  Versions 1.3 and later include intermediate photo/file control.  You may read the CHANGELOG included with the plugin to follow the development, as well as read this thread.

Full-size photo restriction is done by removing the link on the intermediate (displayimage.php) page.  Note that users can still access the full-size photos by guessing & typing in the URL to the file directly into their web browsers  (which avoids Coppermine completely).  You must use some sort of hot-linking protection (described in other threads) to stop such access.  This plugin only restricts access through Coppermine.

Intermediate photo/file restriction is done by removing the link on the corresponding thumbnail and also by denying access to the intermediate page for the file.  Once again, the full-size and intermediate files can still be accessed by typing in the direct URL to the files (which avoids Coppermine completely).

Version 1.0 is the initial release and is described at the bottom of this post.
Version 1.1 is described in this post below (http://forum.coppermine-gallery.net/index.php?topic=25010.msg115060#msg115060).
Version 1.1b is a bug-fix.  I mistakingly hard-coded the config table in 2 queries.
Version 1.2 is described in this post below (http://forum.coppermine-gallery.net/index.php?topic=25010.msg117873#msg117873).
Note: Even though the filename says 1.4.2, this plugin works with the entire 1.4.x series.
Version 1.3 is described in this post below (http://forum.coppermine-gallery.net/index.php?topic=25010.msg171917#msg171917).  The main addition is the control of intermediate images.  Versions prior to 1.3 only controlled the full-size images.
Version 1.4 is described in this post below (http://forum.coppermine-gallery.net/index.php?topic=25010.msg172318#msg172318).  This version includes an option to control images only and a message hover/box for the intermediate file control.


Original posting (for version 1.0):
Here's my first plugin contribution.  It's very simple.  You select which groups you allow to access full-size photos and it does the access validation for you.  This access control is gallery-wide, no choices for categories or albums.  You configure the groups on installation.  If you want to change this, uninstall and re-install.  (I hope there's a plan to add a "configure" button to installed plugins so that the configure function can be run after installation.  Yes I could put together an admin page for the plugin but it seems to me that a simple configure button would be useful and logical and easy to implement.)

This plugin takes a scorched-earth method of filtering the <img src> tag; it kills all other tags (and then blanks out the alt attribute appropriately).

A few thoughts I had while writing this plugin:


Versions 1.2 and 1.4 of the plugin are available for download below.

[Edited By Sami]:
Minor Bug fix
There is a minor template bug (http://forum.coppermine-gallery.net/index.php?topic=45889.0) on both version of this plugin,
position of intermediate image get little messy
to fix this problem you need to edit codebase.php and change
Code: [Select]
$cpicdata['html'] = strip_tags($cpicdata['html'],'<img>');

to this

Code: [Select]
$cpicdata['html'] = strip_tags($cpicdata['html'],'<img><br>');
Title: Re: Plugin: Full-Size Photos Access Control
Post by: imrich on December 12, 2005, 07:15:24 pm
Nice! Thanks for doing this. I'm sure that many people will like it.

I'll take a look at it to see how it works. From your text it appears that there is no control via the groups admin panel. It would be nice to alllow control this way so different options could be set for the different classes of users and administered easily without having to 'install/uninstall'.

It appears that most of the plug-ins are being supported on this other board: http://cpg-contrib.org/board/index.php  I'm still trying to catch up on what's there.

Thanks again!
Title: Re: Plugin: Full-Size Photos Access Control
Post by: Paver on December 12, 2005, 07:23:04 pm
You're welcome.  As I said, right now there is no way to re-configure a plugin without setting up a custom admin page for each plugin which I would prefer to avoid since you can imagine having 10 extra admin pages (with associated buttons on the admin menu) for 10 plugins.  Yes, it would be very easy for me to do this and I will do so if you find that you are re-configuring the access control often.  And there's also no way to modify the group manager page without hacking it, which I want to avoid doing since that negates the usefulness (and sanity) of a plugin.

One suggestion I have is to create a new group called something like "FullSizePhotosAllowed".  Install the plugin and check off this group only.  Then, on the User Manager page, check off all the users you want and at the bottom, select "With Selected: Add secondary membergroup", then choose that group.  When you want to add more users, check off only the new users, and "Add secondary membergroup".  It's an add process, so you don't have to check everything off each time.  To remove users, you'll have to go to each user's page and uncheck that group from their secondary membergroup list.  Hmm... a option to "With Selected: Remove secondary membergroup" might be useful, wouldn't it?
Title: Re: Plugin: Full-Size Photos Access Control
Post by: Paver on December 13, 2005, 02:05:05 am
I just added version 1.1 of this plugin in the first post above.  I noticed a thread on the freelance board (http://forum.coppermine-gallery.net/index.php?topic=24594.0 (http://forum.coppermine-gallery.net/index.php?topic=24594.0)) that seemed simple to add on to this plugin so I did.  With the new addition, you can now require users to comment on a photo before they are able to view the full-size photo.  I'm not sure if this is exactly what Roadster wanted in that thread mostly because I'm not sure why such a user control would be useful.  In any case, there it is.  This new condition can be ANDed or ORed onto the group requirement.
Title: Re: Plugin: Full-Size Photos Access Control
Post by: imrich on December 13, 2005, 01:15:32 pm
I don't quite see the need to force a comment, but some people may like it.

Suggestion, how about adding a configuration control for your plug in to allow this as well as which groups have access to be controlled by it's own configuration panel since there is no way to add to the groups permission managment panel?

Take a look at the CPGMark plug-in (http://cpg-contrib.org/board/index.php?board=14.0), it has it's own configuration panel.
Title: Re: Plugin: Full-Size Photos Access Control
Post by: imrich on December 14, 2005, 11:09:51 pm
I'd also like to clarify (or modify) my suggestion.

I'd like to be able to control which albums (or categories) can be viewed by group.  This would be the ultimate control! :)

Since the group permissions admin panel seemed to have the ability to control access by group, I thought the two would go together. But I suppose that's not a good assumption! ;)
Title: Re: Plugin: Full-Size Photos Access Control
Post by: kavuday on December 15, 2005, 12:28:20 am
I'd like to be able to control which albums (or categories) can be viewed by group.  This would be the ultimate control! :)

Agreed!  Adding this feature would be the icing on the cake.  Hope it can be done.
Title: Re: Plugin: Full-Size Photos Access Control
Post by: Paver on December 16, 2005, 02:03:37 am
You know, you effectively already have this control when using my current plugin.  It's not slick but it does work. 
* Set up a group
* Choose which albums are viewable by the group
* Set up permission for this group with my plugin
* Repeat for each set of albums you want to control

But, yes, I agree it could be more intuitive:  I want this person or group to view this album or category and to be able/not able to view the full-sized photos.  I'm learning how to write plugins and set things up the way I want for my own family's site and in the process contribute back to this excellent project.  Your requests have been noted and I am thinking about ways to answer them in an organized and extensible way (so I can apply them to other plugins).  I will see what I can do. 

But it does seem to me that you have the functionality you requested already, just not in a friendly interface.  If I am not correct, please let me know so I can understand exactly what you are suggesting.
Title: Re: Plugin: Full-Size Photos Access Control
Post by: imrich on December 16, 2005, 02:06:07 pm
Thanks for your work on this. It appears to be working well.

It's not so bad to have the configuration of which groups have full size access done at install time. But it would be nicer if you can create a configuration panel for it similar to what CPGMark has.

Here's another minor suggestion. When someone does not have access to view full size, provide for the option of a message which will be displayed. Something like, "Sorry, you must be logged in and a member of the 'family' group to view view full sized images.".  If this message was configurablle (Display message, or Don't display message), I think this plug in would be even more useful to others.

An additional step may also be to control viewing of intermediate files too.  This way this plug in could provide almost ultimate control:

1) control of intermediate images by group
2) control of full size images by group

I don't know how important it may be to some people to have the control of intermediate images to be by different groups than full size images.

I'm so glad that coppermine has plug-ins now ;D. Previously it was a pain to upgrade if mods were made. Plug-ins will make coppermine a much better tool!  At one time I was going to ask if anyone ever created a tool like phpbb has called "EasyMod", which would help a lot, but plug-ins are much better in the long run if they allow enough hooks in the core code to do what is needed.
Title: Re: Plugin: Full-Size Photos Access Control
Post by: imrich on December 16, 2005, 05:32:45 pm
Here's my first bug report for you, sorry! :)

My gallery has some video's as well as images.

With this installed, users were not able to see the videos. These video's have a thumbnail which I created, but when the user clicks on the thumbnail to view the video, there's just s small square displayed, but no video!  Admin and those with rights to view full size could see the video ok.

Since videos have no 'intermediate' file, they only are 'full size' so to speak. My guess is that any other document type besides images may also have this problem.

I had to 'un-install' this plug in for now.
Title: Re: Plugin: Full-Size Photos Access Control
Post by: mche on December 25, 2005, 10:06:19 am
It would be nice to add user notification or somethig else for users that not loged in that thay can see full size pictures.
Now anonimous users don't suspect pictures have full size
Title: Re: Plugin: Full-Size Photos Access Control
Post by: blablabla on December 26, 2005, 12:52:22 pm
Works great, but I would also like to see some kind of notification that there are full size pictures
Title: Plugin: Full-Size Photos Access Control v1.2
Post by: Paver on December 27, 2005, 11:53:41 pm
Ok, I've released version 1.2 of this plugin.  The plugin is attached to the first message above.

I wasn't sure what sort of notification is best.  Do you want people who are not currently allowed to view the full-size photos to ask you for permission?  Do you really want to list the allowed groups in the notification message as mentioned above?  If someone is not logged in, how do you know when they log in, they will be in the correct group to view full-size images?  Do you want a message box to pop up?  Do you want a mouse hover box?  What I added here is fairly vague and general.  I added a simple message in a tooltip for the intermediate image.  The message is different for anonymous and logged-in users.  You can set each message in the configuration panel.

For other languages, use the lang/english.php as a guide and create your own language file.  The labels and comments may not be completely clear (mostly due to the fact that this plugin is still pretty raw).  Use the plugin to see which is which.  If you want to share your language file with others, attach it here and I'll add it to the plugin package.

As I said before, I prefer to avoid adding a separate config button for every single plugin installed.  Of course, I do see the use of such a panel.  But I would like it to be accessible from a single "Plugin Config" button.  I'll probably put one together sometime and see if others agree once they see it in action.  (something akin to the current config drop-down table but for plugins)

Please give me feedback.  I think I tested the plugin thoroughly but I might have missed something.
Title: Re: Full-Size Photos Access Control
Post by: scottycdl on January 05, 2006, 12:27:31 am
Will this plug-in work with version 1.4.3?
Title: Re: Full-Size Photos Access Control
Post by: Nibbler on January 05, 2006, 12:44:42 am
It is flagged as working for CPG1.4.x
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 05, 2006, 01:15:10 am
scottycdl: If you are curious why "Coppermine 1.4.2 Plugin" is listed in each of the plugin files, that's because I didn't think ahead for future 1.4.x versions.  I removed that text in my own copy of the plugin and the next version (whenever that is) will not have that text.  Using the tag on this thread is a good way to flag the version.
Title: Re: Full-Size Photos Access Control
Post by: scottycdl on January 05, 2006, 01:22:23 am
Okie Dokie. Thanks

Clearly you're a PHP wizard....... how about this, then: member 'timers' that can be set for users such as an expiry time. If I want to offer a 10 day trial, I can add these users to the trial group, and their membership will expire after --- yep, 10 days.

This could be done for a month, year, half-year or whatever is required. This way, I don't need to manually check users' accounts. ONce their time is up, their accounts are locked out. Sound good? Is this even possible?

I have no clue. I just wrestle with the stuff, it is all Greek to me...... but it would be a nice feature, especially for me.

Regards, and thanks for the reply.

ps - I am finding version 143 *so* much better than previous versions and I really like the BLACKBIRCH theme. Right now, I am hoping to incorporate an SWF file on the homepage. I mananged to get an image there, so why not an embedded movie?

Link is http://www.pdistudios.com/cpg143/index.php (http://www.pdistudios.com/cpg143/index.php)
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 05, 2006, 01:33:04 am
You're welcome. 

If you are asking about expirations for full-size photo access, then that is relevant to this plugin and I will consider it.  If you are asking for accounts to expire, that's an issue for a separate thread, in the "Feature Requests" forum.  Please keep to one question/request per thread.  If your P.S. includes a question, the same applies.
Title: Re: Full-Size Photos Access Control
Post by: scottycdl on January 05, 2006, 03:10:57 pm
Is there an idiot's guide to installing this plug in?

Do I dump it directly into the root of my PLUGIN folfer, or must I create a subfolder for it and then point the app to that folder?

I have not installed plug-ins (or anything else) before and would like to give this one a try

Many thanks

-Scotty -
Title: Re: Full-Size Photos Access Control
Post by: Joachim Müller on January 05, 2006, 03:22:21 pm
extract the zip into your plugin folder, preserving the folder structure in the zip file. This way, a sub-folder within the plugin folder will be created and populated with the needed files. Then go to your plugin manager and install the plugin by clicking the "i" button next to it.
Title: Re: Full-Size Photos Access Control
Post by: scottycdl on January 05, 2006, 03:35:37 pm
OK, I did that, and I see the existing plug-ins, i.e. sample and SEF, but the new one is not visible and therefore I cannot click on the " I " to install it.

Ideas?
Title: Re: Full-Size Photos Access Control
Post by: scottycdl on January 05, 2006, 03:42:45 pm
For the record .....


I had to create a subfolder caled control_fullsize and then I could install it. The button apeared on the admin bar and all is hunky-dory

Very cool ...... no brainer

Now I shall test it.....

- Scotty -
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 05, 2006, 04:15:08 pm
Besides creating the folder yourself and manually unzipping the plugin to the correct place, you can also use the BROWSE button on the plugin manager to point to the zip file wherever it is, then use the UPLOAD button to have Coppermine automagically unzip the package and put all the files in the correct place.

Ah, I was going to point to the place in the documentation, but then realized (or remembered reading before) that plugin documentation doesn't exist yet.  I think I can contribute to that sometime.  Time to start a new thread to ask if anyone else has started on this...
Title: Re: Full-Size Photos Access Control
Post by: scottycdl on January 05, 2006, 04:22:05 pm
Anyway my friend, your effort works marvelously! Thank you.

Please feel free to test it (and other CPG stuff) at my site if you wish.

The link is http://www.pdistudios.com/cpg143/index.php (http://www.pdistudios.com/cpg143/index.php)

Regards

- Graham -

(now I wonder how to stop the XP balloons from blabbing file info on mouse hover.... *sigh* )
Title: Re: Full-Size Photos Access Control
Post by: djstretch on January 15, 2006, 02:43:12 am
this seems like such a sill question but, i downloaded the zip file, extracted it and then dumped the extracted files into my plugins folder in coppermine. Now i have no idea where the configure panel is for it. I looked in the "config" panel withing my photo album but it doesn't seem to be there. Need help.

Eric
djstretch@msn.com
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 15, 2006, 05:31:44 am
On the config page, under general settings, there's a Yes/No Enable Plugins choice, with a link to "Manage Plugins" next to it.  From the plugin manager you can install new plugins that aren't in the plugins folder yet by clicking Browse, pointing to the zip file, then clicking upload.  Coppermine will upzip the package, create the folder and move the files in there.
Title: Re: Full-Size Photos Access Control
Post by: docgonzo on January 17, 2006, 10:25:54 pm
First of all, let me say, excellent idea for a plugin, i've been waiting for a simple way to do it for some time now.
I downloaded, unzipped, uploaded & installed your plugin in coppermine.
But I cannot get it to work for the love of god.
I set the groups that can view pics to 'Registered' only, but i was still able to view them when logged out.
Is there something i'm missing ?
BTW, i'm running the MiniCPG & Multiline-comments plugins on a CPG 1.4.3(stable).
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 18, 2006, 03:47:11 am
I just tested things out and my plugin works on my installation fine.  When you're logged out, your user group is "Guests" or whatever you named the Guest/Anonymous group and as long as you don't have that group checked off in my plugin configuration, you shouldn't be able to access the full-size photos.

Make sure you refresh the page after you log out.  Maybe your web browser cached the page and is showing you the old one from when you were logged in.

At first I read your post incorrectly and thought it wasn't working for certain members even though you had Registered checked off.  Here's what I typed when I thought that (and include here in case this information is useful for someone):

The Registered group is actually not a special group at all.  Each user has to be a member of this Registered group; it's not an automatic behind-the-scenes thing.  So usually (and by default) each user has a primary group of "Registered" and then you set the secondary groups to be any other ones.  If you changed the primary group to something other than "Registered", then that user cannot be a member of the Registered group as secondary group - so I guess the "Registered" group is special only in that it cannot be listed as a secondary group.

So ideally, set each user to Registered for the primary and add the other groups as secondary memberships.  You can mass-apply secondary group membership to multiple users on the group manager page using the "With Selected" drop-down box - very useful!
Title: Re: Full-Size Photos Access Control
Post by: Roadster on January 18, 2006, 11:20:08 am
Paver, I'm REALLY Sorry Did not realize your post @ mine topic... I've had ask DJMaze to fix mine first comment then download problem for me.. And I had already payed him.. But untill 2day still no answer from him..

2night I'm going to try your add on and wil test it! Thanks in advance.
Title: Re: Full-Size Photos Access Control
Post by: docgonzo on January 18, 2006, 01:51:53 pm
I've set-up the plugin exactly als you told me to, as you can see from the screenshot :
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fbrol.docgonzo.com%2Fcpg_fspac-config.gif&hash=8c10512fe194b5ca02abd649c409bc292a53a769)

but still, as an unregistered, not-logged-in visitor, i can still see the full size pictures.

My groups config is below :
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fbrol.docgonzo.com%2Fcpg_groups-config.gif&hash=eb4ba38144235acc38801d97361f972a19f44a81)

I've tried lots of different settings, but none make it so that 'Anonymous/Guest' users cannot see the full size picture.
It doesn't have anything to do with the 'Assigned Albums', or am I wrong?
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 18, 2006, 04:25:12 pm
Roadster:  No problem.  As I said, it was easy to add your request to my plugin so I did.  If it works for you, that's great.  If not, let me know and I might be able to add something to my plugin.  No worries about pay.  It's great that you offered to pay for a mod.  That's very generous.
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 18, 2006, 04:51:15 pm
docgonzo:  Using your image URL, I went over to your site, and I think I figured out what the issue is.  (OK, it wouldn't have been that difficult to guess.)

My plugin removes the full-size pop-up link from the intermediate image on the display-image page.  If you don't have an intermediate image, then the full-size photo is used directly on the display-image page and my plugin is not applicable since there is no link for a full-size popup.

Others have mentioned controlling the intermediate image display as well, and I put that in the back of my head for future investigation.  The FAQ in the Coppermine documentation has used to have a simple hack to only show thumbnails to anonymous users and intermediate/full-size images to registered users.  It's a one-line hack to the displayimage.php script.  It used to be in the docs but I don't see it right now.  It's not ideal because it merely outputs an error when the displayimage.php script is loaded by an anonymous user.  Ideally, you shouldn't have the link on the thumbnails page to begin with.

If this describes your issue and you don't want to use the one-line hack (found somewhere - it's been mentioned at least once on the forums), then I guess wait to see if I add this control to my plugin.  I'll take a look at it today and do a feasibility analysis.

If this is not your issue, then let me know and we'll do some more troubleshooting.

By the way, there should be a blank line between the User Comment Yes/No and the checkbox for the "display notice".  In your screenshot there isn't and I just want to make sure that's not a theme issue where the line breaks are ignored.  If you modified my plugin_config form, that's fine.  If not, what theme are you using so I can look at that sometime.  If it's a custom theme, that's cool.  I'm just curious.
Title: Re: Full-Size Photos Access Control
Post by: docgonzo on January 18, 2006, 08:21:43 pm
Ahh, forgot about that  :-[ I should have mentioned i don't use the full size pop-up :/
But I've had coppermine configged like this for such a long time, i had forgotten there even was a full size pop-up...
My excuses for that.

I'm not too happy about going in and hacking to only show thumbnails to anonymous users and intermediate/full-size images to registered users...
And if you've searched on my nickname, you would see that I've already been waiting a long time for this feature ;)
But I don't wanna rush you or anything, i've waited 2 years for this, so i'm not really in that big of a hurry.
(just wanted to make it more interesting to become a registered user)

I'm using a lighly modded version of the BlackBirch theme, only changed the position of the adminmenu and the bannerposition in template.html and my own banner
I didn't touch the plug-in, though.
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 18, 2006, 11:11:21 pm
docgonzo: It looks like what you're asking for can be done in your theme.php file.  Since you're only asking for a simple "registered or not" condition (instead of choosing groups that may change in the future), you can modify the thumbnail display in your theme.php to remove the link to the intermediate/full-size photo for those not logged in.  I assume you would want a tooltip/mouse hover message that says "Login/Register to see full-size photos' instead of the current tooltip with the filename/dimensions/etc (which would be good to remove since the filename would give people more of an idea how to bypass any checks you set up - then again, looking at the thumbnail image would give people who want to figure it out enough information to figure it out, so unless you are using random filenames for the thumbnails or using an .htaccess rule, you cannot stop people from manually typing in the address of the full-size photo - but I digress).

It doesn't look too difficult to add this control to my plugin as well.  I'll do something similar to modifying the theme variables & functions, but with the added configuration of groups and being able to disable & enable such a control programatically.

Would you like me to tell you how to modify your theme.php to do what you want?  It's more than a few steps but not too difficult.  Or do you want to just wait for the next version of the plugin?  I cannot promise a release date but I'm thinking it will be soon - i.e. a day or two - unless I get waylayed. 
Title: Re: Full-Size Photos Access Control
Post by: docgonzo on January 18, 2006, 11:34:18 pm
Take your time Paver...
But i want to be able to add more user categories in the future, because i'm gonna work with multiple standalone photographers, and then the full sizepicture will matter, as that is the way they have to get it on the server...
So then my registered users would only be able to see the thulbnails and the intermediates, and the photographers would be able to see intermediate AND full size
I'm not in a rush...
Title: Re: Full-Size Photos Access Control
Post by: Joachim Müller on January 18, 2006, 11:40:46 pm
The FAQ in the Coppermine documentation has used to have a simple hack to only show thumbnails to anonymous users and intermediate/full-size images to registered users.  It's a one-line hack to the displayimage.php script.  It used to be in the docs but I don't see it right now.
http://coppermine-gallery.net/demo/cpg13x/docs/faq.htm#viewThumbnailsOnly
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 18, 2006, 11:49:00 pm
docgonzo: Roger that.  We'll see what happens.  It's often a mystery to me when I do things, what with a baby's desires to contend with.    :D

GauGau: Gracias.  I thought I had seen it in the 1.4 docs but now I'm sure I overlooked the fact that I was looking at the 1.3 docs instead.  The new 1.4 theme system has made this particular hack moot and not preferrable for all the reasons hacks are not preferrable.  I'll search to see if anyone has posted about how to do this with a theme customization in 1.4 and if not, I'll post it (not here of course).
Title: Re: Full-Size Photos Access Control
Post by: Roadster on January 19, 2006, 09:34:26 am
@Paver, I've installed the plugin last night... And you're the best!!

It works excellent!!! I've already send you a pm with a question..
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 19, 2006, 09:26:05 pm
You're welcome.  As I said in my reply to your PM, let's keep questions on the public boards.
Title: Re: Full-Size Photos Access Control
Post by: Trulla on January 26, 2006, 08:55:19 pm
First: Great mod! I installed the plugin and it works fine.

Now my question: When anonymous users hover over the intermediate picture they get a ALT/TITLE message that there is a full size picture but they are only able to see it when they're logged in. Is it possible to use a pop up window when clicking on the intermediate picture instead of the alt text?
I know how to make such a pop up but I don't get it to work with the plugin... I'm not very good when it comes to PHP so I don't know which code I have to replace etc.
Title: Re: Full-Size Photos Access Control
Post by: Paver on January 26, 2006, 09:47:53 pm
I'm working on the next release of this plugin to include control of the intermediate image (or the full-size one if you don't use intermediate images - i.e. the image on displayimage.php page with the filmstrip below it).  I could easily add in a pop-up option for the "not allowed" message.  I asked in a previous post above about this and you are the first to request something different.

I could tell you how to modify things to do so, but since I can add it to the next release, is that sufficient?  You can see then what I did.   :)
Title: Re: Full-Size Photos Access Control
Post by: Trulla on January 28, 2006, 09:25:02 pm
I could tell you how to modify things to do so, but since I can add it to the next release, is that sufficient?  You can see then what I did.   :)
I asked a friend to help me... he knows PHP better than me.. and he just replaced this code in codebase.php

Code: [Select]
$cpicdata['html'] = preg_replace('/alt=\".*\"/i','alt="'.$alt_text.'" title="'.$alt_text.'"',$cpicdata['html']);
with this one:

Code: [Select]
$cpicdata['html'] = preg_replace('/alt=\".*\"/i',"onClick=\"alert('".$alt_text."')\"",$cpicdata['html']);
Works fine for me right now but I'm still looking forward to the next release of this plugin.  :) Great work, really.  ;)
Title: Re: Full-Size Photos Access Control
Post by: Rush_To_Me on January 29, 2006, 04:23:15 pm
Thank you Paver & Trulla  ;D Great Plugin
Title: Re: Full-Size Photos Access Control
Post by: cornelp on February 02, 2006, 04:53:53 pm
 ;D

Thank You Paver. U are owesome. Plugin worked PERFECT.

THANK YOU...

 :D
Title: Re: Full-Size Photos Access Control
Post by: CRCs Reality on February 26, 2006, 06:57:32 pm
Just a quick thanks for a slick plugin, great work Paver :)
Title: Re: Full-Size Photos Access Control
Post by: docgonzo on June 18, 2006, 11:18:14 pm
Any word on progress with the new version?

I've recently switched my setup, to accomodate use of your plugin,
and was wondering of you were going to develop it further, with the suggested features.

I don't want to rush you or anything though.
I'm just curious :)
Title: Re: Full-Size Photos Access Control
Post by: Paver on June 19, 2006, 12:12:27 am
In the back of my mind, I knew I had a few things to add to this plugin, but I forgot how much I had discussed this, especially in the last post above where I mentioned the next version as if it were imminent.  Sorry about that.  I should be careful about promising anything.

I'll take a look and see what it takes to do what we discussed.  Thanks for the bump.  6 months is surely a reasonable time for a bump & check.
Title: Re: Full-Size Photos Access Control
Post by: Bazzah on June 27, 2006, 06:18:21 pm
Just want to say thanks  - I have been pulling my hair out all day trying to do something like this!
Title: Re: Full-Size Photos Access Control
Post by: majay on July 02, 2006, 09:25:06 pm
Thanks for this great plugin Paver!

@ Tulla: thanks for the code you provided in order to allow a window to pop up, however, I don't understand where you're supposed to enter the link to the window you want to pop up. Could you please explain?

Thank you!
Title: Re: Full-Size Photos Access Control
Post by: Davide Renda on August 20, 2006, 03:21:02 pm
I'm just noticing that, when logged as admin but in "user mode", full size pics are blocked. I don't think being a config problem, as except guest/anonymous, all groups have access to full size pics.
Title: Re: Full-Size Photos Access Control
Post by: Joachim Müller on August 20, 2006, 09:42:40 pm
Never leave "admin mode" then. ;D
Title: Re: Full-Size Photos Access Control
Post by: spewbert on September 20, 2006, 11:19:12 pm
hi there Ive tried installing the plugin but getting error when opening index.php

Fatal error: Call to undefined function: get_meta_album_set() in /home/rawimage/public_html/gallery/index.php on line 757

also when opening plugin_config.php codebase.php getting Not in Coppermine...and configuration.php getting a blank white page any ideas whats going on?

link www.raw-image.net/gallery/
Title: Re: Full-Size Photos Access Control
Post by: Paver on September 21, 2006, 12:36:01 am
@spewbert: I don't understand why you would get the index.php error when using this plugin.  For the other errors, those are "as designed" - you're not supposed to open those plugin scripts outside of Coppermine.  So the only error you have is the "Call to undefined function" error.  And I don't understand how that happened.  "get_meta_album_set()" is a function defined in include/functions.inc.php and has nothing to do with the plugin, as far as I can tell.

As a side issue, you are running a fairly old version of Coppermine (1.4.5).  You should upgrade to the latest version (1.4.9).  I don't think this upgrade will fix the issue - unless you have modified one of the core scripts and upgrading will restore the original (correct) code.  When doing an upgrade, you'll have to re-apply any hacks you have made to the core scripts.
Title: Re: Full-Size Photos Access Control
Post by: lordfrikk on September 21, 2006, 02:17:03 pm
I do not want to be a nuisance but you said in January that you're working on the version that count with intermediate thumbs :'( Is there any chance you'll get it working any time now?
Title: Re: Full-Size Photos Access Control
Post by: Paver on September 24, 2006, 06:48:20 am
Version 1.3 of this plugin has been released.  See the first post in this thread (http://forum.coppermine-gallery.net/index.php?topic=25010.40).

The new features are:

edit: Note that I did not implement any message on the thumbnails page for users that are not allowed to view the intermediate images.  Since the "mouse hover" message is taken up by the file info, I'm not sure what would be appropriate.  If people that use the intermediate access control think a message is required, please suggest precise details of how this message should appear (in a popup alert box, in a "mouse hover" message, in a link to another page like a registration page).
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Sami on September 24, 2006, 06:55:31 am
Nice work Paver :)
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: tutone on September 26, 2006, 12:14:37 am
This is what i have been looking/waiting for. Brilliant!

One issue... unregistered users cannot click on/open video thumbnails. This mod seems to affect videos as well as images. I didn't install the previous version. But, I thought i read that you had fixed it so that this only affects images. Is that not the case anymore?

Thanks again. This is so freaking awesome!

With regards to text informing the unregistered user that they must login/register to see the intermediary or fullsize version... i would vote to have some sort of pop up. Or even a message at the top of the thumnail page... indicating that they must login to see the intermediary. It would seem like clicking on the image would be appropriate. As it is a natural occurance... a user clicks on the image to get the larger picture... and then a pop up appears informing the person to login/register. Right now, if you were a new user and you tried to click on the thumbnail, there would be no link - nothing happens. They would have no clue that it was possible to see a larger version of the file. Upon clicking on the image (which is natural internet behavior) they currently do not get a response so the implication is that clicking does nothing and they would have no idea that registering would give them this ability. Let me know if I make no sense...
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Paver on September 26, 2006, 12:33:43 am
@tutone: You're welcome.  Your comments on the intermediate popup and text next to the album title are good ones.  I'll consider them, since as you said, a user blocked from intermediate photos might not realize such photos are available.

As for the video thumbnails, you are correct in saying that I fixed an issue with non-image files in version 1.2.  That version only validated image files for full-size access (as does version 1.3 in regards to full-size access).  I forgot about this when adding the intermediate control, so the intermediate control removes all access to displayimage.php for all files.  Once again, I'll have to modify the plugin to treat only image files.  In this case, it's not an error as it was in the previous version, but rather a control-happy plugin.  I'll add in an option to do what it does now - control all files on the thumbnail page - versus controlling only images.

I have no idea when I'll finish this next version, but since version 1.3 is still clear in my mind, there's a good chance I'll look at it soon.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Paver on September 26, 2006, 05:16:27 am
Version 1.4 has been released and is included on the first post, as usual.

The additions are:

Non-image files are only controlled for intermediate access (clicking on the thumbnail to pull up the intermediate page).  "Full-size" access is not applicable to such non-image files.

For the intermediate message, you can include the tag {TYPE} to include the file type (whatever it is for the particular thumbnail).  The default message uses this tag, so you can see it in action.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: tutone on September 26, 2006, 07:41:55 pm
Simply Amazing!!!! I seriously have been waiting for this since I installed coppermine years ago. Exactly what I wanted. Your the best. Now if I can just find a plugin to show the user's on the main page  :)

Seriously... very grateful!!!
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Paver on September 26, 2006, 09:10:05 pm
You're welcome again.  Let me know if there are any issues.

For the users on the main page, do you mean something like this: "User albums" on the index-page? (http://forum.coppermine-gallery.net/index.php?topic=32825.0)  Since this is off-topic, please start your own thread (on the appropriate support board) if you have something else in mind. 
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: KlausH on October 10, 2006, 05:48:39 pm
Thanks for that! We needed this for a restriced photo-community; so you made my day!:-)
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Shades on October 23, 2006, 04:23:17 pm
Awesome plugin Paver, thank you it's just what I needed.

However, it seems to overlook permissions for individual albums. Meaning when you configure the plugin so that guests can only view thumbnails, but if you have also assigned some albums to unlogged users, then guests can't see any intermediate & full-size, no matter what.

I would like to have guests restricted to thumbnails only set by default, but allow them to view inter. & full pictures in some albums. Would that be possible?
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Paver on October 23, 2006, 11:00:16 pm
@Shades: I've thought about this briefly before, but not in much detail.  The main question is how much should the plugin do?  On one end, the plugin has a section where it lets you set permission levels for every single album; on the other end, the plugin looks at album permissions and takes them into account in some reasonable way.  Obviously, it would be simplest from the interface-point-of-view to have the permission level right there on the album properties page, but that would take a lot of work using the plugin framework and may be rendered moot if & when the core permission system for Coppermine is overhauled.

So, thinking about your question now, I would suggest the following.  Add an option where either the plugin overrides all permissions site-wide (as it is now) or the plugin overrides only those albums with permission set to "everyone" or "registered" (maybe another option) and leaves alone albums with permission set to another usergroup.  People in that usergroup will have full access to the album, with the plugin not getting involved at all.

There might be some issues from the user-point-of-view, so please let me know if you think of any.  (When I say "user", I mean the user of the plugin, which is actually the gallery admin.)  Would this suggestion do what you want?
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Shades on October 24, 2006, 02:09:55 am
Thanks for your reply, Paver.

Yes, what you suggested sounds convenient for what I'm trying to do! I can't really think of any admin issues, though.
In my gallery there are none but the "Guests" and "Registered" groups, and I only have a minor number of albums that I wish to make 100% public, so in my personal case your option idea would suit me perfectly well.

Thanks again.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: pda4de on October 28, 2006, 05:00:04 pm
FYI. The control_fullsize (1.2 & 1.4) plug-in files are not working with Safari ( Mac OS 10.4.8 ). The lower options are not shown and the DONE button is not present. Using IE 5.2 is a workaround.

PDA
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Hein Traag on November 08, 2006, 10:14:49 am
Installed on CPG 1.4.10
Tested with IE 7 and FF 2.0

Great plugin Paver, it does the job perfectly!

Cheers!
Hein

p.s. Dutch language file added to post
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Senator on November 30, 2006, 09:40:06 pm
I've installed the Full-Size Photos Access Control v1.4 plugin, and it works fine fore a month.

Now i've got a problem with it. When use this plugin, it works for a few hour, till the server at my providers crashed.

My site has today killed the providerserver for three times today. And many  all the sites that they hosted on that server was down.

My provider has contact me, and told that the webserver and the database server crashed, by my site.


My site overkilled the databaseserver, en the link the gave me, leads to this plugin.

Now i've uninstalled this plugin, and my site gives no problem anymore with the server, and my provider has no problem anymore.

So i think this plugin take too much of  dbserver processing. Maybe i've not set the good settings in the plugin.

Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Paver on November 30, 2006, 10:35:21 pm
Strange.  What was the link they gave you?
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Senator on December 01, 2006, 01:12:04 pm
the url they gave me was

httpdocs/plugins/control_fullsize

They told me that this plugin is the problem.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: wuschel_lux on February 05, 2007, 10:50:57 am
Hi,

first of all thanks for this great plugin. I need it really but I have some small problems with it.

I am using Stramms Package and Photo Shop v1.3.3.

Installation of Full-Size Photos Access Control v1.4 was succesfull, with the controll panel I could select rights, which I set to Intermediate for guests. After this I could no more use the pulldown of the shop. I got the content of the pulldown in text form and the pic is gone to the right an 'distroyed' the table layout.

Is there a problem to use Photo Shop and this plugin?

best regards

www.volleyball.lu/fotogallery


EDIT:
=====
Problem solved. I change the plugin order and it works realy fine.

Again thanks for this GREAT plugin
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Bazzah on February 15, 2007, 02:22:20 pm
Obviously this is a problem my end, but hopefully someone can help. I have used this mod for quite a while now, but I have just discovered that new groups I create in my forums are no longer shown in this mod. I use coppermine bridged with IPB. For some reason, the full size access mod is showing old groups that I have removed, and not new ones. Is this a problem with my database tables? If someone could help me, I would really appreciate it. Oh, and I don't have a clue about PHP, so please be patient with me ;D
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Nibbler on February 15, 2007, 03:16:40 pm
You need to visit the groups page in Coppermine to resync the groups.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Bazzah on February 15, 2007, 04:53:09 pm
Sweet! Thanks Nibbler! (Again)
Title: Re: possible little bug with IPAC plug
Post by: Timos-Welt on March 04, 2007, 03:25:12 pm
Thanks very much for the great plug in. I am using 'cpg1.4.2_plugin_control_fullsize_1.2.zip' on cpg1.4.10.

For those who are not allowed to view the full size pictures, the border around the pic in intermediate view gets unsymmetrical or non-uniform in size. Happens with all skins and on IE7 and Firefox2.

Screenshots:
http://www.timos-welt.de/BorderBug_Firefox.jpg
http://www.timos-welt.de/BorderBug_IE.jpg

Any solution?

TIA
Timo
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Hein Traag on March 05, 2007, 02:08:20 pm
I run the plugin on classic_vertical_filmstrip theme.. no such problem here. Did you try uploading a picture that was not in your CPG before ?
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Timos-Welt on March 06, 2007, 06:16:21 am
Yes, same result.  :(
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: reas0n on June 28, 2007, 08:58:14 am
ok im running the 1.2 version of this plug cause thats all i really need but when i check "Display this notice to users not allowed to view full-size photos" it doesnt show the message i cant even click on the picture...i wanted to get it so they have to register if they want to see the pic full sized but it wont even let me send them to the message...any ideas????
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: dke on July 19, 2007, 06:59:42 pm
Very nice plugin indeed, but as mentioned above, it would be real nice if it was possible to allow guests to view full size images in chosen albums while in the rest they will have 0 access.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Ingalb on August 07, 2007, 04:25:26 pm
Hi  Paver,

thanks a lot for this plug-in.

I have CGP 4.10 and integtated with phpBB forum.
The plugin works well in the album where are photo but not in other album where are video or audio files....

Ex. 

http://www.fkvllaznia.net/main/album/thumbnails.php?album=2    (here the plugin function)

http://www.fkvllaznia.net/main/album/thumbnails.php?album=4  (here the plugin do not function)

Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Sami on August 07, 2007, 04:35:16 pm
There should be an option for non image file

What do you want to control? -> everything
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Ingalb on August 07, 2007, 11:50:01 pm
There should be an option for non image file

What do you want to control? -> everything


Thanks Sami,

I haven't see that option  ::) :-\
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: just_some_guy on September 22, 2007, 10:14:03 am
Hey,

Sorry if this has been asked b4. I am using a modded version of CPG, with stramms mod pack. I see that init.php and the lang file will need editited. What parts do i edit to make both work?

Also does this mod remove the alt attribute of the file location too?

Thanks.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: greggan on December 14, 2008, 05:21:50 pm
Great plugin but it dont work when Lightbox is used for fullsize images.
Is it possible to get this plugin to restrict Lightbox popup to show for logged in users only?
It does not work just to disable full size view :0(

Ref: Lightbox [ http://forum.coppermine-gallery.net/index.php/topic,35539.0.html ]

Regards/ Stefan
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Joachim Müller on March 28, 2009, 09:50:36 am
A few thoughts I had while writing this plugin:
  • If groupmgr.php had a plugin hook, I could add a "allow full-size access" setting there.
Why not add such a hook now to cpg1.5.x while you still can *hint*  ;)

Joachim
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: paul__cz on March 31, 2009, 11:32:01 pm
Hi all! I have this error massage after click to normal picture (600x400px). I can open original large picture.

Fatal error: Cannot redeclare loginform() (previously declared in .../include/themes.inc.php:2717) in ...theme.php on line 833

Thanks
Paul__cz
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Joachim Müller on April 01, 2009, 08:38:03 am
The file include/themes.inc.php doesn't contain a function named loginform(). You must have introduced that in error. Undo it. Not related to this thread. Read up board rules, then start a thread of your own if you can't get this issue solved on your own.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Mimer on May 31, 2009, 02:08:59 pm
Danish language file updated for v. 1.4 based on english.php.
Revision 1.1

Mimer  8)
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: jolly on June 19, 2009, 08:56:35 pm
There is one problem ;(

I am using Enlargeit plugin as well, and unfortunetly that both plugins did not work togheter.

Even if I set that Guest can only see thumbnails, after click, Enlargeit shown pictture in full size.

Any chances make that plugins cooporate?
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: jolly on June 19, 2009, 09:36:55 pm
Ok, solved.
It did not notice I can set it in Enlargeit config.
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: jolly on June 21, 2009, 10:26:54 pm
It's me again.
This is great plugin Paver, really very usefull. But I wonder, is it possible to apply this plugin only for one album? For instatnt, album numer 5 ?
In other words: registered users have full size access for every albums, except album number 5. They can see only thumbnails picture.
What do you think ?
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: Bash on November 26, 2009, 11:47:55 pm
This mod is excellent has all the options I needed. Thanks!
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: durangod on January 02, 2010, 11:25:11 pm
IM so very happy i ran into this, i was just sitting here thinking of a way to keep joe smoe public from downloading any photo they wanted and two seconds into that thought i ran into this mod, its installed and running PERFECTLY, really nice job... excellent by brain thanks you...
Title: Re: Full-Size & Intermediate Photos Access Control
Post by: soluzioninrete on October 28, 2010, 05:40:40 pm
A user with 'intermediate' access level can view fullsize picture by directly accessing the right URL with the browser.
Patch proposed:

Index: codebase.php
===================================================================
@@ -137,7 +137,7 @@
 
   // Restrict access to DisplayImage.php if not allowed to view intermediate images
   if ($CONFIG['plugin_controlfullsize_controleverything'] && defined('DISPLAYIMAGE_PHP') && !GALLERY_ADMIN_MODE) {
-    $validuser = controlfullsize_validate('intermediate');
+    $validuser = controlfullsize_validate('fullsize') || (is_null($_REQUEST['fullsize']) && controlfullsize_validate('intermediate'));
     if (!$validuser) {
       load_template();
       pageheader($lang_error);