I have a Open Social Application and maintained at my ning network. And i wanted to store the user records which one accessed my application.
Could you please help me how to get the current user details and what is the best method to store the records.
You need to create a use the newFetchPersonRequest() data request function. The name of person you need to specify is VIEWER. Checkout the Accessing Member Information example and let me know if you have further questions. Here is the relevant code:
var req = opensocial.newDataRequest();
var viewer = opensocial.IdSpec.PersonId.VIEWER;
Thank you very much Devin,
Now i wanted to display Users in my webpage (i.e. Drupal content Page). I have placed the code in my webpage source code as like this:
$users = NingApi::instance()->user->fetchNRecent(5);
$returnData['users'] = $users;
When i execute this page getting following error message:
Fatal error: Uncaught Invalid query parameters. Suspect parameters: [amp;fields] Options are: ? ?private=true ?private=false ?author=* ?author=*&private=true ?author=*&private=false ?approved=false ?approved=true ?author=*&approved=false ?author=*&approved=true (400) 2-3 thrown in /var/www/vhosts/mendprogramme.org/httpdocs/sites/default/files/ning_apps/api/src/NingException.php on line 56
Could you please help me how to execute my code in drupal page.
It looks like there is an encoding issue with the URL. The 'Suspect parameters: [amp;fields]' part shows that the URL's ampersand (&) was converted to an HTML entity. The PHP function htmlentities() does this but the default PHP client code doesn't contain that function.
I haven't been able to reproduce this issue. Did you make any modifications to the Ning PHP client code?