I am designing a webpage that has some image content displayed using imagefield-gallery. I know this module is using an old copy of lightbox2 (is it already corrected?) but I understand it will grab lightbox2 if it is there.

Ok, let's to to the question. I am showing the thumbnails gallery to everyone, but when they press the thumbnail I want that anon users get redirected to the login/registration page but registered users can view the image.

If this is possible, could you tell me how? Must I Theme something or is it already implemented?

Comments

stella’s picture

Status: Active » Closed (won't fix)

You are correct about imagefield-gallery module. It uses an old lightbox2 version, but if you have lightbox2 module installed, it will use that one instead.

As for the redirection, that's not really something lightbox2 can, or should, do. I'm not sure if this is an issue for imagefield gallery, imagefield or imagecache modules however. Maybe check out the http://drupal.org/project/cck_field_perms module first.

Cheers,
Stella

Farreres’s picture

I don't mean that this is a feature lightbox2 should be offering, but could you give me some hint as to where should I go to have this feature in my webpage? What module's responsibility is this? I think I could tweak lightbox2 so that it links to the registration page but could you give me some directions? Just to go faster.

stella’s picture

I would check out the http://drupal.org/project/cck_field_perms module, or perhaps one of the content access modules. You may need some custom code, I'm not sure.

If you're modifying the lightbox2 to add the link, then perhaps look at the lightbox2_field_formatter() or lightbox2_imagefield_image_imagecache() functions.

Farreres’s picture

I think it is lightbox2 what I need to modify. If I use ccl_field_perms I will allow or deny the whole field, but I want that all users can see the thumbnails, I only want the large images to be limited to registered users. The easiest way for me would be that when a user presses a thumbnail, the link directs him to the registration page in case they aren't registered. I will check the final code of the gallery in addition to the two functions you have suggested me to check.

stella’s picture

Actually this is already possible with imagecache I think. It provides a "view" permission for each imagecache preset. See the "imagecache module" section on admin/user/access You will need to set your "file system" settings to "private" and may need to move your files directory out of the web root dir.

Cheers,
Stella

joergfelser’s picture

Version: 5.x-2.8 » 6.x-1.11
Status: Closed (won't fix) » Active

Hi everybody,

is that still possible with drupal 6 & lightbox2 version 6.x-1.11?
I'm still searching for exactly the same functionality but still didn't find a way
to realise that...
@Farreres --> did you ever realise what you were searching for? if yes, how did you do it?

Thanks in advance and
best regards
Jörg