Piwigo.org

You are not logged in. (Register / Login)

Announcement

Post a reply

Write your message and submit

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

Zaphod
2012-08-14 23:16:15

I've made some small adaptations, and it works great, thanks a lot.
(the adaptations are just for my taste, your original script worked)

Zaphod
2012-08-09 23:09:31

Thanks a lot, I'll try this.

rvelices
2012-08-09 23:07:02

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

Code:

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;
}
Zaphod
2012-08-09 22:25:19

Can you be a little more specific about how i can "enrich" the thumbnails ?
I'm not familiar with php...

rvelices
2012-08-09 21:42:53

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

Zaphod
2012-08-09 20:43:54

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...

rvelices
2012-08-09 15:35:57

Zaphod wrote:

I think the "has_hd" value was taking into account user rights.

No

Zaphod
2012-08-09 13:58:41

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.

rvelices
2012-08-09 13:48:56

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 ...)

Code:

{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

Zaphod
2012-08-09 11:25:28

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"?

rvelices
2012-08-09 09:32:12

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
2012-08-07 22:42:18

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.

Zaphod
2012-05-02 22:55:05

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...

flop25
2012-05-02 22:50:49

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 ^^

Zaphod
2012-05-02 22:48:07

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.

Board footer

Powered by FluxBB

About this website · Donate · Contact Piwigo project © 2002-2013