1. Add photo(s), description(s)
1. Create an album for the competition
2. Set limit for number of photo submissions per member
3. Approve Photos
4. Restrict certain members from participating in competition
This photo app should ideally be a Profile App. I later have to create a mobile app for IPHONE for the same functionality.
What I have done so far:
1. I have upgraded my Network to Ning Pro.
Need advice (from Devin and others) moving forward:
1. I know how to get the consumer key and consumer secret.
How do I access Ning API to write PHP code ?
2. Do I have to setup a separate server environment on a host like Godaddy to access
NIng API ?
I am afraid, I have searched Ning discussions and have not found documentations
on how to set up the environment to enable me to access NIng API.
1. To access the consumer key and secret, browse to the /main/extend/keys page on your Pro network. More details here: http://build.ning.com/profiles/blogs/getting-started
2. Yes, you'll need to have your own server in order to make requests to Ning. If you're working in PHP, a Linux shared hosting account on GoDaddy should be sufficient. Here's a guide to getting going in PHP: http://developer.ning.com/docs/ningapi/1.0/examples/php/php.html
Let me know if you have any more questions.
Thanks for getting back to me.
I put the Ning API files in my GoDaddy server account where I'm running Wordpress.
Below are the first 7 lines of my NingApi.php file:
2 define('SRC_PATH', __DIR__);
3 define('OBJECTS_PATH', SRC_PATH . '/objects');
4 set_include_path(get_include_path() . PATH_SEPARATOR . SRC_PATH . PATH_SEPARATOR . OBJECTS_PATH);
When I test, I can access the NingApi.php file. I get an error in line 4 and line 7(when NingObject.php is being called).
Warning: require_once(NingActivityItem.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/m/o/n/monitor12/html/app/ning-api-php/src/NingObject.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'NingActivityItem.php' (include_path='.:/usr/local/php5/lib/php:__DIR__:__DIR__/objects') in /home/content/m/o/n/monitor12/html/app/ning-api-php/src/NingObject.php on line 4
The 'absolute path' is on my server acct is "/home/content/m/o/n/monitor12/html/".
I think the error that I am getting is because of the 'absolute path'. It may also be a Wordpress problem.
Please suggest a solution.
The error there is in NingObject.php, not NingApi.php. Have you copied the 'objects' directory up to the web server? It looks like you have NingApi.php and NingObject.php but not objects/NingActivityItem.php.
1. I had to fix the path in NingObject.php, for instance:
2. I also had to fix the path in all the files under the 'objects' folder.
For instance, in NingActivityItem.php, I changed the path where it calls NingObject.php
In short, the objects in the 'object' folder extend NingObject, but they couldn't find NingObject so the file path had to be fixed accordingly.
That's odd. Perhaps set_include_path isn't working on your server? Glad to hear you got it working!
My project is to create a Photo Competition.
1. Allow user to add a photo to a photo album.
How can I specify an album name and author (screenname) when adding a photo ?
Can I retrieve a list of unapproved photos for a particular album ?
Also do you have good examples on how to use the restful api resource links. REST is all new to me.
More questions for Phil:
While adding a photo I'm getting the following error:
Fatal error: Uncaught cURL error: failed creating formpost data thrown
The reason for this error is probably(see in bold)
$parts = array( "title" => $_POST["title"],
"description" => $_POST["description"],
"file" => "@\C:\Users\BBB\Desktop\DSC03028.jpg" );
Is Ning API expecting the full local path appended by "@\" ?
Where am I erring in terms of "file" ? Please help.
I don't think you can specify an album name... looking at the documentation and our code, I don't see anything for that.
The name / screenname on the photo are taken from the credentials used to upload it. Authenticate as the user whose details you want to see on the photo.
Phillip Pearson said: