Announcement

#16 2017-01-20 14:32:04

CharlieM
Member
Gloucester, UK
2015-04-27
71

Re: PiwigoPress

I'm not sure where to start with that I'm afraid.

Offline

 

#17 2017-01-20 18:13:52

eliz82
Member
Romania
2016-04-27
281

Re: PiwigoPress

depends on what are you tring to do ?
insert some images from Piwigo in some Wordpress post? Or showing the latest pictures from Piwigo into Wordpress sidebar?

try to save this as test.html on your webserver, then access in your browser.

Code:

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var p_api = 'http://yarnwhispering.co.uk/pix/ws.php?format=json&method=pwg.images.getInfo&image_id=40'; //piwigo web api location
var request = new XMLHttpRequest();
request.open('GET', p_api, true);
request.onload = function() {
  if (request.status >= 200 && request.status < 400) {
    var mydata = JSON.parse(request.responseText);
    alert(JSON.stringify(mydata, null, '    ')); //do something with the data
  }
};
request.send();
</script>
</head>
<body>
</body>
</html>

if you see an alert box with data info from that image then it's working.

Offline

 

#18 2017-01-22 19:38:28

CharlieM
Member
Gloucester, UK
2015-04-27
71

Re: PiwigoPress

No alert I'm afraid:-

http://www.yarnwhispering.co.uk/testloop3.php

Mind this doesn't work if I run it form my local machine either.

Offline

 

#19 2017-01-22 23:15:17

eliz82
Member
Romania
2016-04-27
281

Re: PiwigoPress

try http://yarnwhispering.co.uk/testloop3.php
:)

@edit: to make it work also with www try to enable cors in your htaccess file your host allow this kind of config
http://enable-cors.org/server_apache.html

or put www to this

Code:

var p_api = 'http://yarnwhispering.co.uk/pix/ws.php?format=json&method=pwg.images.getInfo&image_id=40'; //piwigo web api location

I already asked Piwigo developers to enable cors for the json output
http://piwigo.org/forum/viewtopic.php?p … 84#p165084

Last edited by eliz82 (2017-01-22 23:27:23)

Offline

 

#20 2017-01-23 11:50:42

CharlieM
Member
Gloucester, UK
2015-04-27
71

Re: PiwigoPress

Well that works making the .htaccess change. So with your help I've established that PHP code amendments to the plugin aren't going to work. That the only way of integrating Piwigo with WordPress on the same server is using JS.

Clearly replicating the plugin features is a major task and well beyond me. However with your help I do have a way, with a bit of amateur hacking, of getting some things to work.

@eliz82 many many thanks for all the help you've offered, I am really grateful. Its just a shame that the plugin author wasn't equally interested in establishing why his code wasn't working. I'm hoping that as a  minimum I can persuade him to amend the plugin description to highlight the shortcoming to save others in the future expending so much energy on a blind alley.

Offline

 

#21 2017-01-24 13:53:01

norbusan
Member
Komatsu, Ishikawa, Japan
2011-06-11
61

Re: PiwigoPress

I am happy about technical advice or pull request to fix this problem. I just didn't have the time to try to track something down that does not happen nor on my test server nor on my real server.

The code is all in github, pull requests are greatly appreciated.

Norbert

Offline

 

#22 2017-01-24 16:40:45

CharlieM
Member
Gloucester, UK
2015-04-27
71

Re: PiwigoPress

That's great @norbusan, is this something you could fix then? Not being an expert in this I do not understand what is meant by "pull requests".

Offline

 

Board footer

Powered by FluxBB

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