Announcement

#1 2011-12-14 11:38:27

heras
Member
2011-10-20
3

[resolved] Is it possible to restrict guest access to only thumbnails?

Hey,

I started to use piwigo, which i find the best gallery available, and have a question about the guest user.

In my setup i installed the plugin GThumb+. When a guest clicks on an album he sees the overview of all the pictures in it. That is also the only thing he should be able to view. So when he clicks then on one of the pictures he should get the login page.

Is it possible to restrict guest access to only thumbnails?

Best regards,

Peter

Last edited by heras (2011-12-14 11:38:59)

Offline

 

#2 2011-12-14 11:52:42

P@t
Piwigo Team
Nice
2007-06-13
4098

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

Open LocalFiles Editor plugin, go to 5th tab (personal plugin) and insert this code:

Code:

add_event_handler('loc_begin_picture', 'personal_guest_picture_access');

function personal_guest_picture_access()
{
  if (is_a_guest()) access_denied();
}

Then, activate the personal plugin on plugins page.


P@t

Offline

 

#3 2011-12-14 12:19:51

heras
Member
2011-10-20
3

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

Great, thats what i needed.

Thanks

Offline

 

#4 2011-12-16 09:24:17

mol
Piwigo Team Germany
germany
2010-05-26
108

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

P@t wrote:

Then, activate the personal plugin on plugins page.

working.

and now, please, with the possibility to configure it on album level too,  like :
"if user guest and album id {array} show only thumbs ..." (i´m not a programmer!) ;-}
and with a nice usergui :-) :-)

Offline

 

#5 2015-01-22 11:21:56

KimCums
Member
2015-01-22
2

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

The above code snippet doesn't seem to be working anymore.
Is there an updated version for 2.7+ perhaps?

Offline

 

#6 2015-01-22 11:45:37

flop25
Piwigo Team
2006-07-06
7037

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

have you checked the plugins available?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2015-01-22 21:36:16

KimCums
Member
2015-01-22
2

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

Guest Thumb View Only looks like what I need, but it hasn't been updated for 2.7;
http://piwigo.org/ext/extension_view.php?eid=607

Offline

 

#8 2024-04-15 01:37:33

lonjazurbaran
Member
2023-10-01
12

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

That Plug-in is not working now (2024) for Piwigo 14, right?

After investigating as much as I can, now in 2024 it seems not to be posible. (I need to make only thumbnails accessible to guests)

Anyone has a solution?

I want my galleries to remain private, but guess must see the thumbnails :-(

Offline

 

#9 2024-04-15 13:04:46

OHappyDay
Member
2023-02-08
60

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

Hi,

I tested the code as mentioned above and it worked as expected. After clicking on an image I get the login page.

Newest version of piwigo (14.3)

Last edited by OHappyDay (2024-04-15 13:05:34)

Offline

 

#10 2024-04-16 20:08:55

lonjazurbaran
Member
2023-10-01
12

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

Thanks a lot for your help. I think I'm on the right way, but still doesn't work for me. Guests can see any picture without limit.

This code is literally what I have now in my 'Personal Plugin' (activated thanks to 'LocalFiles Editor' Plugin)

<?php
/*
Plugin Name: Personal Plugin
Version: 1.0
Description: Personal Plugin
Plugin URI: http://piwigo.org
Author:
Author URI:
*/

add_event_handler('loc_begin_picture', 'personal_guest_picture_access');

function personal_guest_picture_access()
{
  if (is_a_guest()) access_denied();
}

?>


Why doesn't it work? Do I need to add any other variable o syntax there? Do albums or galleries need to be configured in a special way?

Last edited by lonjazurbaran (2024-04-16 20:10:00)

Offline

 

#11 2024-04-16 23:31:27

OHappyDay
Member
2023-02-08
60

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

Strange enough. It is exactly what I did and access is then limited. No idea what is different in your case.

Offline

 

#12 2024-04-17 00:58:43

lonjazurbaran
Member
2023-10-01
12

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

I see the problem. The plugin is working, but:

I need guests just to see the Album thumbnail (not to enter and see the rest of the thumbnails).

This plugin allows access to the album (thumbnails) and only restricts further view.

Is there any way to modify code it so that when guest clics on the Album thumbnail the 'Login' appears?

Thanks a lot for your help.

Offline

 

#13 2024-04-17 01:37:08

lonjazurbaran
Member
2023-10-01
12

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

One more problem:
This code seem to work in desktop browsers, but the pictures are still fully shown in mobiles :-(

Offline

 

#14 2024-04-17 13:11:43

OHappyDay
Member
2023-02-08
60

Re: [resolved] Is it possible to restrict guest access to only thumbnails?

My idea was to create an event handler that is triggered when an album is displayed.

I tried to find such a trigger that identifies the display of an album (like loc_begin_picture for the display of an image) to create another event handler (similar to that from previous posts).
Unfortunately there are some other triggers but none seem to be related to the album display. This is what I found in the root directory of my installation in .php files:

loc_begin_about
loc_begin_admin
loc_begin_admin_page
loc_begin_comments
... and more

So, my conclusion is that it seems not to be possible to achieve that.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact