Announcement

  •  » Themes
  •  » [2.4] [multisize] Theme adaptations

#16 2012-08-09 11:25:28

Zaphod
Former Piwigo Team
2006-11-13
441

Re: [2.4] [multisize] Theme adaptations

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

 

#17 2012-08-09 13:48:56

rvelices
Former Piwigo Team
2005-12-29
1960

Re: [2.4] [multisize] Theme adaptations

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

Offline

 

#18 2012-08-09 13:58:41

Zaphod
Former Piwigo Team
2006-11-13
441

Re: [2.4] [multisize] Theme adaptations

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

 

#19 2012-08-09 15:35:57

rvelices
Former Piwigo Team
2005-12-29
1960

Re: [2.4] [multisize] Theme adaptations

Zaphod wrote:

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

No

Offline

 

#20 2012-08-09 20:43:54

Zaphod
Former Piwigo Team
2006-11-13
441

Re: [2.4] [multisize] Theme adaptations

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

 

#21 2012-08-09 21:42:53

rvelices
Former Piwigo Team
2005-12-29
1960

Re: [2.4] [multisize] Theme adaptations

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

 

#22 2012-08-09 22:25:19

Zaphod
Former Piwigo Team
2006-11-13
441

Re: [2.4] [multisize] Theme adaptations

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

Offline

 

#23 2012-08-09 23:07:02

rvelices
Former Piwigo Team
2005-12-29
1960

Re: [2.4] [multisize] Theme adaptations

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;
}

Offline

 

#24 2012-08-09 23:09:31

Zaphod
Former Piwigo Team
2006-11-13
441

Re: [2.4] [multisize] Theme adaptations

Thanks a lot, I'll try this.

Offline

 

#25 2012-08-14 23:16:15

Zaphod
Former Piwigo Team
2006-11-13
441

Re: [2.4] [multisize] Theme adaptations

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

 
  •  » Themes
  •  » [2.4] [multisize] Theme adaptations

Board footer

Powered by FluxBB

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