Announcement

#1 2015-03-08 20:57:10

abravorus
Member
2015-03-03
36

Embeddable image block

Hello,

I need to embed one or more images from my Piwigo gallery to the external pages of my web-site. But not just an image (this is clear how to do), but the "image block" - thumbnail of the given size which is a link to the one of the bigger size image with watermark. The image could be defined by it's path or id.

Is there any way to generate such an "image block" by Piwigo Web API or any internal Piwigo PHP-functions available for embeding to external pages? May be some examples are available or somebody already implemented that?

Piwigo version: 2.7.4
PHP version: 5.4.36
MySQL version: 5.5.41
nginx

Offline

 

#2 2015-03-08 22:49:38

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Embeddable image block

don't really understand what you mean...

Code:

<a href="http://galerie.strangeplanet.fr/i.php?/upload/2013/10/05/20131005215449-6ceef2d2-la.jpg">
<img src="http://galerie.strangeplanet.fr/i.php?/upload/2013/10/05/20131005215449-6ceef2d2-th.jpg">
</a>

this is the thumbnail with link to large (note the "th" and "la" suffixes)

renders has
http://galerie.strangeplanet.fr/i.php?/upload/2013/10/05/20131005215449-6ceef2d2-th.jpg

isn't that what you want ?

Offline

 

#3 2015-03-09 21:09:59

abravorus
Member
2015-03-03
36

Re: Embeddable image block

That's correct. But, you need to know path and image file name, which includes randomly generated part.

I know , that you can get the image url from the image page by right click on the image, etc. But, imagine that you need to install several, may be tens of such a blocks, it will take a lot of time doing this manually. I would like to generate this code by php-function only by image id. I understand, in general, how to do it - select from piwigo_images table path and file name by known id and generate the code from retrieved data. I just thought that there is already "standard" code for this.

Offline

 

Board footer

Powered by FluxBB

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