What i want to do is to have the equivalent of the "download" link you have on the picture page, as stripped-galleria displays the picture, but on the thumbnail page.
If I understand correctly, there is no such thing as "HD" in piwigo 2.4 anymore.
There is just the original image?
So the "has_hd" value does not exists anymore as it is always "yes"?
Last edited by Zaphod (2012-08-09 11:25:50)
Offline
Zaphod wrote:
What i want to do is to have the equivalent of the "download" link you have on the picture page, as stripped-galleria displays the picture, but on the thumbnail page.
what you could do is something like (not tested ...)
{if ($thumb.src_image->is_original())} a href={$thumb.id|@get_action_url:'e':true} {/if}
the only issue would be if the user is not allowed to see the original ...
Zaphod wrote:
If I understand correctly, there is no such thing as "HD" in piwigo 2.4 anymore.
There is just the original image?
So the "has_hd" value does not exists anymore as it is always "yes"?
exact
Offline
rvelices wrote:
the only issue would be if the user is not allowed to see the original ...
Yes, this could be an important issue...
I think the "has_hd" value was taking into account user rights.
I can't display the download link for everyone.
Offline
Zaphod wrote:
I think the "has_hd" value was taking into account user rights.
No
Offline
In fact, I have to access to the equivalent of what is available on the picture page:
U_DOWNLOAD to know if I add the download link
U_ORIGINAL to know if I can display the original in the lightbox (in case original is chosen in stripped options for HD picture)
If it's not possible, I just can't allow to download original...
Last edited by Zaphod (2012-08-09 20:44:32)
Offline
What you could do is add an event handler on loc_end_index_thumbnails in your theme and enrich your thumbs as done on the picture page
Offline
Can you be a little more specific about how i can "enrich" the thumbnails ?
I'm not familiar with php...
Offline
Zaphod wrote:
Can you be a little more specific about how i can "enrich" the thumbnails ?
I'm not familiar with php...
not tested but here is the idea
add_event_handler('loc_end_index_thumbnails', 'toto', 50, 2); function toto($tpl_vars, $pictures) { global $user; foreach($tpl_vars as &$x) { if ($x['src_image']->is_original()) {// we have a photo if ($user['enabled_high']) $x['TOTO_URL'] = $x['src_image']->get_url(); } else // no photo $x['TOTO_URL'] = get_element_url($x); } unset($x); return $tpl_vars; }
Offline
Thanks a lot, I'll try this.
Offline
I've made some small adaptations, and it works great, thanks a lot.
(the adaptations are just for my taste, your original script worked)
Offline