EnglishI've made some small adaptations, and it works great, thanks a lot.
(the adaptations are just for my taste, your original script worked)
Thanks a lot, I'll try this.
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;
}Can you be a little more specific about how i can "enrich" the thumbnails ?
I'm not familiar with php...
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
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...
Zaphod wrote:
I think the "has_hd" value was taking into account user rights.
No
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.
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
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"?
Zaphod wrote:
In fact, I still didn't update this part in stripped-galleria.
I dont' know how to do it.
The point is to have access to :
-> the fact the hd picture exists (has_hd)
-> the hd picture path
from the thumbnail page.
There is no such thing as the HD in 2.4. Instead you can always access {$thumbnail.src_image} which is an object of type SrcImage (defined in derivatives.inc.php if you want to take a look att all possible function members). You can call {$thumbnail.src_image->get_url()}
I don't know what you want to do with it, but I strongly doubt you need it. The orginal src_image could for example be raw output from a camera always in landscape mode but with an orientation flag ...
Zaphod wrote:
2) In stripped-galleria, I have to access all the data from the thumbnail page.
So, in addition to the {$thumbnail.FILE_PATH} I need, I also need to access to HD picture so I used two things:
-> {$thumbnail.FILE_HAS_HD} which doesn't work anymore. What is the equivalent now?
-> {$thumbnail.HD_PATH} which was generated by php in themeconf.inc.php:Code:
add_event_handler('loc_end_index_thumbnails', 'add_thumbnails_high_url', 50, 2); function add_thumbnails_high_url($tpl_var, $pictures) { include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); foreach($tpl_var as $key => $value) { if ($value['FILE_HAS_HD']) { $tpl_var[$key]['HD_PATH'] = get_high_path($pictures[$key]); } } return $tpl_var; }How can I update this code to work again?
In fact, I still didn't update this part in stripped-galleria.
I dont' know how to do it.
The point is to have access to :
-> the fact the hd picture exists (has_hd)
-> the hd picture path
from the thumbnail page.
Yes I know about this.
This would be great, even if I don't realize how much work it would need.
I think it would not be so difficult to implement it in a theme, but I still don't know how to code a plugin...
Zaphod wrote:
I used this:
flop25 wrote:
I've seen this
$derivative = new DerivativeImage($derivativeParams, new SrcImage($row));
$derivative->get_url();in themeconf.inc.php and it works perfectly.
Now that I understand how the derivative work... the next step is to manage to choose automatically the best derivative for the screen (and that would be able to replace the autosize function of stripped)
But this will wait a little.
topic:19253 ^^
I used this:
flop25 wrote:
I've seen this
$derivative = new DerivativeImage($derivativeParams, new SrcImage($row));
$derivative->get_url();
in themeconf.inc.php and it works perfectly.
Now that I understand how the derivative work... the next step is to manage to choose automatically the best derivative for the screen (and that would be able to replace the autosize function of stripped)
But this will wait a little.