Announcement

#1 2018-04-15 23:55:28

msbt
Member
2018-04-15
3

How to display the author of an image with the API?

Hi there!

I'm currently trying to embed images on an external page and I'm having troubles getting the authors name.

var authorName;
var imgComment;

authorName = img.author;
imgComment = img.comment;

<img title="'+authorName+'"...
<span class="comment">'+imgComment+...

Displaying the comment works, but the author output is giving me an "undefined".

Piwigo 2.9.3
Operating system: Linux
PHP: 7.0.28-0ubuntu0.16.04.1 (Show info) [2018-04-15 21:51:12]
MySQL: 5.7.20-0ubuntu0.16.04.1 [2018-04-15 21:51:12]
Graphics Library: External ImageMagick 6.8.9-9

Any pointers would be appreciated!

Best regards,
M

Offline

 

#2 2018-04-24 21:13:56

msbt
Member
2018-04-15
3

Re: How to display the author of an image with the API?

Ok I just realized that author doesn't have its own field, is there a way to grab it from the image infos?
Best regards

Offline

 

#3 2018-04-25 01:55:37

executive
Member
2017-08-16
1214

Re: How to display the author of an image with the API?

Yes.
see "pwg.images.getInfo" under  http://piwigo.org/demo/tools/ws.htm
It returns author (among other things)

Offline

 

#4 2018-04-25 19:13:37

msbt
Member
2018-04-15
3

Re: How to display the author of an image with the API?

Yes that I have, but I can't figure out how to catch only the title. Doesn't matter though, I'll just use the image name as author and comment as description.

Thanks for you input!

Offline

 

#5 2018-04-25 20:49:54

executive
Member
2017-08-16
1214

Re: How to display the author of an image with the API?

Offline

 

Board footer

Powered by FluxBB

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