// Ning network subdomain (ie. 'apiexample' in apiexample.ning.com)
public $subdomain = '';
// Ning user email address
protected $email = '';
// Ning user password
protected $password = '';
// Consumer key found at [subdomain].ning.com/main/extend/keys
protected $consumerKey = '';
// Consumer secret found at [subdomain].ning.com/main/extend/keys
protected $consumerSecret = '';
$ningApi = new NingApi();
$args['description'] = "Test blog post description.";
$args['title'] = "Test blog post title.";
__construct($subdomain, $consumerKey, $consumerSecret, $accessToken = NULL, $accessTokenSecret = NULL)
__construct($subdomain=null, $consumerKey=null, $consumerSecret=null, $email=null, $password=null)
Hi Ben !
Thanks for this update. It's more powerfull like that.
Just a (potential) issue that frightens me : how can i get "author" field (screen name) now?
Oh, please Ben, tell me it's me who does not understand anything and that I can still request screen name ...
You are still able to get the author field from from all content. For fetching users, the call looks like this: NingApi::instance()->user->fetch($args);
You still have to specify a selection criteria, e.g. $args['id'] = '1234:User:678', but then by default the author field should be returned.
All of the methods still allow you to pass an arguments array that is identical to what you would pass to the NingApi in the previous version. If you'd like only a subset of possible fields, then you can set $args['fields'] to be the comma-separated list like you would in the previous api library version.
Sorry to scare you like that! There shouldn't be anything you cannot do with this new library version that you could with the previous, but let me know if you find otherwise.
And thanks for this precision. I confess I am a bit lost in the reingeniering of my code.
If I do that, it throw an exception (Missing one or more of the following required constants in /xxx/NingApi.php: subdomain, email, password, consumerKey, consumerSecret) on the second line :
$ningApi = new NingApi($subdomain, $ckey, $csecret, $name, $pass);
What am I doing wrong ?
Sorry about that - that's definitely a bug. Thanks for pointing it out. I just pushed a fix for this to github, but please let me know if you see any more problems.
This is great, thank you! Is this likely to be updated at any point? What are all the extra fields in the user, and how do I populate them?
The curl connection is returning the #7 error number.
I think its because my offices use a proxy so it might be blocking the connection somehow.
do you have any idea how i can fix this.
I did try adding this code below the $ch = curl_init(); line of the call method.
curl_setopt($ch, CURLOPT_TIMEOUT, self::CURL_TIMEOUT);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt($ch, CURLOPT_PROXY, "proxy_address");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_URL, "my network address");
Any help is appreciated thanks in advance.
© 2023 Created by Build Team. Powered by