This is the first time I try to write a Piwigo Plugin.
Actually, what I want to do is same as Plugin "Protected Albums", a password protected album but shown on album listing. However, after I tried "Protected Albums", I found that the photo still able to view by Search, tag, flat....etc, I think that maybe impractical to implement another security without support by the piwigo core.
I think it is better to use the Piwigo user security, and write a plugin to display the pirate album thumbnail to public, so it will ask for login after clicking on it.
What I am doing is add_event_handler at loc_begin_index_category_thumbnails, reset the array $categories to display the private album thumbnail. It is working now, I may try to add an admin page to select which private album to show.
Then, I want to ask, is it a good way to implement the plugin? Or there is another plugin/built-in function to accomplish this?
Offline
that seems good
so the album is private, and the plugin displays the representative thumbnail : it's the own chosen by piwigo or a specific picture ?
great work, it sounds interesting !
Offline
flop25 wrote:
so the album is private, and the plugin displays the representative thumbnail : it's the own chosen by piwigo or a specific picture ?
I am just using the same logic as Piwigo for representative thumbnail.
One of the problem if the representative thumbnail is not set, maybe the random photo is inappropriate for public (a reason I want to protect the album is contain nude photo). But I will set the a representative thumbnail to private album if I want to list it to public.
Offline
in 2.4 we introduce a new image by default : http://piwigo.org/dev/browser/trunk/the … nknown.png or you can use a generic image, representing a picture http://www.iconarchive.com/search?q=picture
Offline
flop25 wrote:
in 2.4 we introduce a new image by default : http://piwigo.org/dev/browser/trunk/the … nknown.png or you can use a generic image, representing a picture http://www.iconarchive.com/search?q=picture
I want to keep a preset thumbnail from album photo, that seem a little bit awful when a lock icon appear on album listing suddenly.
BTW, though I can get all info in a query(ie, nb_images, date_last, max_date_last, count_images....), it maybe a heavy loading sql. So I want to keep the info similar as the user_cache_categories, but I feel lost on trace where is piwigo update the table user_cache_categories? such as number of photo change, number of category change..... etc
Last edited by fatman (2012-06-28 18:23:05)
Offline