how to fetch the current logged user details. - Build2024-03-28T19:54:04Zhttp://build.ning.com/forum/topics/how-to-fetch-the-current?commentId=6308082%3AComment%3A3412&xg_source=activity&feed=yes&xn_auth=noIt looks like there is an enc…tag:build.ning.com,2011-04-28:6308082:Comment:33412011-04-28T16:35:58.691ZDevinhttp://build.ning.com/profile/Devin
<p>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 <a href="http://php.net/manual/en/function.htmlentities.php" target="_blank">htmlentities()</a> does this but the default PHP client code doesn't contain that function.</p>
<p> </p>
<p>I haven't been able to reproduce this issue. Did you make any modifications to the Ning PHP client code?</p>
<p> </p>
<p>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 <a href="http://php.net/manual/en/function.htmlentities.php" target="_blank">htmlentities()</a> does this but the default PHP client code doesn't contain that function.</p>
<p> </p>
<p>I haven't been able to reproduce this issue. Did you make any modifications to the Ning PHP client code?</p>
<p> </p> Thank you very much Devin,
…tag:build.ning.com,2011-04-20:6308082:Comment:33232011-04-20T05:05:41.563ZV Lakshmojee Raohttp://build.ning.com/profile/VLakshmojeeRao
<p>Thank you very much Devin,</p>
<p> </p>
<p>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:</p>
<p><?php</p>
<p>require_once(file_directory_path().'/ning_apps/api/src/NingApi.php');</p>
<p>$users = NingApi::instance()->user->fetchNRecent(5);</p>
<p>$returnData['users'] = $users;</p>
<p>print(json_encode($returnData));</p>
<p>?></p>
<p>When i execute this page getting following error…</p>
<p>Thank you very much Devin,</p>
<p> </p>
<p>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:</p>
<p><?php</p>
<p>require_once(file_directory_path().'/ning_apps/api/src/NingApi.php');</p>
<p>$users = NingApi::instance()->user->fetchNRecent(5);</p>
<p>$returnData['users'] = $users;</p>
<p>print(json_encode($returnData));</p>
<p>?></p>
<p>When i execute this page getting following error message:</p>
<p> </p>
<p><b>Fatal error</b>: 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 <b>/var/www/vhosts/mendprogramme.org/httpdocs/sites/default/files/ning_apps/api/src/NingException.php</b> on line <b>56</b></p>
<p> </p>
<p><b>Could you please help me how to execute my code in drupal page.</b></p>
<p> </p>
<p><b>Thanks</b></p>
<p><b>VLRao<br/></b></p> You need to create a use the…tag:build.ning.com,2011-04-12:6308082:Comment:34122011-04-12T16:18:38.499ZDevinhttp://build.ning.com/profile/Devin
<p>You need to create a use the newFetchPersonRequest() data request function. The name of person you need to specify is <em>VIEWER</em>. Checkout the <a href="http://developer.ning.com/docs/opensocial/1.0/overview/profile-data.html#accessing-profile-information" target="_blank">Accessing Member Information</a> example and let me know if you have further questions. Here is the relevant code:</p>
<blockquote><p>var req = opensocial.newDataRequest();<br></br> var viewer =…</p>
</blockquote>
<p>You need to create a use the newFetchPersonRequest() data request function. The name of person you need to specify is <em>VIEWER</em>. Checkout the <a href="http://developer.ning.com/docs/opensocial/1.0/overview/profile-data.html#accessing-profile-information" target="_blank">Accessing Member Information</a> example and let me know if you have further questions. Here is the relevant code:</p>
<blockquote><p>var req = opensocial.newDataRequest();<br/> var viewer = opensocial.IdSpec.PersonId.VIEWER;<br/>
req.add(req.newFetchPersonRequest(viewer), 'viewer');<br/>
req.send(callbackFunction);<br />
</p>
</blockquote>