Ning Developer Docs

Hi all, I am trying to figure out a way to determine the Profile > Name (ie Username) variable which is visible in the Ning bar at the top, and also in the MySettings box in the upper right (ie above "Sign Out").

We are building a Form that a Member can fill out and I would like to include the Username as a field on the Form. Currently they have to enter this manually, best would be if this could be detected dynamically. By knowing this Username I can construct a link to their Profile, ex http://networkname.com/profile/Username.

I've tried the OpenSocial examples, was able to make them work, and was able to obtain the Member data (including Username), but the solution is limited because A) they have to install an app B) it only works on their My Profile page.

It sounds like obtaining these variables (on any page) was possible with some PHP and the previous Ning API implementation. Can this still be done?

Thanks, Steve

Views: 11

Replies to This Discussion

Yes, using javascript, the username is in the variable:

ning.CurrentProfile.fullName

Code an onload function that gets that variable and assigns it to the innerHTML of the textbox of your choice.
Perfect, thanks TJ! That script was just what I needed. This also seems to work on individual pages if you put the code straight into the Edit Page window. If anyone is interested in testing this, here's a simple script that demonstrates TJ's solution. Thanks again.

[script language="javascript" type="text/javascript"]
alert('Here is the ning profile:'+ ning.CurrentProfile.fullName);
[/script]

Note: replace "[]" with "<>" to run
You're welcome. Always glad to be of help!
Using Javascript is it possible to get the current users email?
I don't believe so, unless you use a jQuery.getJSON interface to an external database app that records all member's email addresses upon sign in, along with their Ning ID. Then you could use the ning.Current Profile.id to index into that DB table and retrieve the email field of the matching record. Not easily done, but possible!
Thanks TJ

I need a roster app built that has a record of a users firstname, lastname, email, mobile. Ive addded mobile as a profile question. Ideally its a single signon solution, so i assume authentication would be similar to the wordpress plugin.

My question is, can i add code to the ning 'registration' page so that when a user joins my ning site, they are also registered in this custom app with the above 4 fields? Or would you add the code to a 'signin' page (as you mentioned above)?

Or would you approach this in a different way? Not much of a developer, but need to know if this is possible :)
The only way I can think of doing this is doing it 100% manualy. Useing Jotform after a member register's you edit the GreenBox that appear's to have a form that request there E-Mail Fist Name, Last Name,Mobile then they submit it then you have to store it in mabey an excel file. But this is alot of work.
I may be able to do this but it would require you to get a server then I would have to charge you for a custom quote of 50$-75$ depending on the amount of code's I would ahve to code.
Thanks,
The Ning Scripter
AKA Josh

E-Mail: Ning.Scripter@yahoo.com
You can add code to any page as long as Ning keeps the Analytics textbox on our manage tabs. That's the only way we can hook into the pages with code since the PHP source code was closed off last October. We do still have the Ning Authentication API and you can use that to see if a given email and password belong to a Ning Network member. If so, you get back their name, email and avatar url in a serialized variable. I have code to do the Auth in PHP and in ASP.NET and I can do a DB app but I can't provide it at the rates Josh is quoting so I'd hire him! :)
hi, where can i find more of these javascipt calls? thanks!

"TJ" @ www.TheNingMaster.com said:
Yes, using javascript, the username is in the variable:

ning.CurrentProfile.fullName

Code an onload function that gets that variable and assigns it to the innerHTML of the textbox of your choice.
You can find more JavaScript Calls Here
ok, i signed up to your site. however, where can i find calls such as:

ning.CurrentProfile.fullName

?????????????

JP @ TheNingMaster.Com said:
You can find more JavaScript Calls Here

RSS

© 2026   Created by Ning Developer Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service