Hi all
Is there a way that you can display a members name on a custom made page. We are trying to make a survey to integrate into Ning and would like to make the survey more personalised and pull in their name, email address and other profile info (if appropriate) from what they have already entered.
This would be useful as we don't want to have to ask members to fill in this information first to sign up to our site, then be asked the same information again in another form built in the website.
Any help would be great. we are using RightNOW (work CRM System) to build the survey so you would great for any feedback if people have done this kind of activity before.
Thanks
Tags: details, dynamic, forms, intergrate, members, personalised
Permalink Reply by Rob Andrews on May 29, 2012 at 9:25pm The best way for this would be to work the ADVANCED API of Ning into your site.
While I haven't seen nings API, it goes back to the basics of forms with your social network DB. Somewhere their is a DB of all data collected. Whatever DB is more intense (your sites DB's vs. NING) determines which DB you want to integrate where. It all depends on your call to action so to speak.
But if its as simple as something like setting up an online account- ect., for security reasons, I would intigrate your NING API into your own DB.
Thats just me.
Permalink Reply by Ben Low on May 29, 2012 at 10:04pm Hi Rob
All I really want to do is put on a users existing name and further details on a page. I'm not really looking into creating my own intensive DB. For example see snapshot below:
From some of the info on the Ning API I can't determine if it enables me to be able to do this. As I can see that Ning already does this it owuld be great if I can simply grab that existing code that is working in Ning and simply drop it into the page I want to make.
Thanks for the response though.
Ben
Permalink Reply by Rob Andrews on May 29, 2012 at 11:42pm I notice that NING has a third party app to do it, but that is obviously not what your looking for.
I dont know the hosting policy of NING for files stored on server... But if they gave API ability? every member is assigned a value in PHPMYADMIN. (Im taking a shot in the dark that their using this as a local DB)
If you did use a DB to do it, this is a lot simpler than what I expected. Let me research a little on the API when I get back. I figure this would be a poll from your "sign up" questions you ask, which I believe you can display on the users page.code would be similar to to the php (Im a WP user, so I write in this format, bare with me)
alot of the Third party apps render using GOOGLE ajax (indicated by the wave bar effects, a smart move by the developers) so you would need to store a file somewhere. this indicates php support
(the reason I knew I could run my php now playing script in a text box on the right of my site, http://beattransit.ning.com ((Shameless plug, work in progress)).
basiclly to do it from scratch, you would need to piggyback a php call to another call (maybe simpler, but I use my output in multiple areas, so it works best for me) You would need to store a file on a server somewhere that collects the data, and then outputs it elsewhere in another text box on your site. I had to screw this code up a little so it doesnt start functioning due to no code tags in this reply box, but you will get the drift:
<?php
$vote = $_REQUEST['vote'];
//get content of textfile
$filename = "poll_result.txt";
$content = file($filename);
///the content of your sites array
$array = explode("||", $content[0]);
$///CHANGE ME: VALUE OF CHOICE 1/// = $array[0];
$///CHANGE ME: VALUE OF CHOICE 2/// = $array[1];
if ($vote == 0)
{
$//CHANGE ME: VALUE OF CHOICE 1/// = $//CHANGE ME: VALUE OF CHOICE 1/// + 1;
}
if ($vote == 1)
{
$///CHANGE ME: VALUE OF CHOICE 2/// = $///CHANGE ME: VALUE OF CHOICE 2/// + 1;
}
///slap it a txt file for output
$insertvote = $///CHANGE ME: VALUE OF CHOICE 1///" vs. ".$///CHANGE ME: VALUE OF CHOICE 2///;
$fp = fopen($filename,"w");
fputs($fp,$insertvote);
fclose($fp);
?>
///keep in mind if you use a cheap host to do this, F Socket is prob closed and this wont work.///
<h2>Result:</h2>
<table>
<tr>
<td>//CHANGE ME: VALUE OF CHOICE 1///:</td>
<td>
<img src="poll.gif"
width='<?php echo(100*round($yes/($///CHANGE ME: VALUE OF CHOICE 2///+$yes),2)); ?>'
height='20'>
<?php echo(100*round($//CHANGE ME: VALUE OF CHOICE 1////($///CHANGE ME: VALUE OF CHOICE 2///+$///CHANGE ME: VALUE OF CHOICE 1///),2)); ?>%
</td>
</tr>
<tr>
<td>No:</td>
<td>
<img src="poll.gif"
width='<?php echo(100*round($no/($///CHANGE ME: VALUE OF CHOICE 2///+$///CHANGE ME: VALUE OF CHOICE 1///),2)); ?>'
height='20'>
<?php echo(100*round($///CHANGE ME: VALUE OF CHOICE 2////($///CHANGE ME: VALUE OF CHOICE 2///+$///CHANGE ME: VALUE OF CHOICE 1///),2)); ?>%
</td>
</tr>
</table>
Then you would render the call to the script (all in nice neat W3C compliant script by calling to this HTML File wrapped in a php container (though if you use heavy PHP, theres no such thing as W3C compliant). Call the PHP in a text box box on the site.
<html>
<head>
<script type="text/javascript">
function getVote(int)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("poll").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","poll_vote.php?vote="+int,true);
xmlhttp.send();
}
</script>
</head>
<body>
<div id="poll">
<h3>CHANGE ME: ASK YOUR QUESTION</h3>
<form>
///CHANGE ME: VALUE OF CHOICE 1///:
<input type="radio" name="vote" value="0" onclick="getVote(this.value)" />
<br />///CHANGE ME: VALUE OF CHOICE 2///:
<input type="radio" name="vote" value="1" onclick="getVote(this.value)" />
</form>
</div>
</body>
</html>
Basiclly, you create your own pull from scratch. The API aspect of NING would be to get the field value of the user (numeric integer attached to the name value of the user). Then add some good ol IFF magic to cause the value to stick to the users profile. A little more coding, but not that difficult if you watch enough Youtube videos on PHPMYADMIN (my only tutor)
Then output the value of the vote onto the profile.
Im sure NING is doing something similar to refine their voting values (as seen on announcements, it appears others had issues with form outputs) I wouldnt use this code if your doing something professional as this is more "lemonade stand" coding by someone hopped up on mountain dew (myself) after a 14 hour work day (better believe it)
but its just a start of how you would intigrate interface with DB's from scratch using some API.
Permalink Reply by Ben Low on May 30, 2012 at 12:19am thanks for the answer but I don't think it really answers what I'm trying to do. I'm a bit confused by all your code now but thanks for trying I'll goggle around to see what I get and post the answer.
Permalink Reply by Rob Andrews on May 30, 2012 at 12:29am sorry I couldn't be of more help.
Permalink Reply by Andy Nelson on May 30, 2012 at 7:29pm Rob would you happen to know if, when you make a new page on your ning website that only signed in users can see, you can make the page say something like "Welcome %FIRST_NAME%"?

soaringeagle replied to Alex's discussion 'More styling in the Design Studio'
soaringeagle replied to Alex's discussion 'More styling in the Design Studio'
Margie replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
soaringeagle replied to Alex's discussion 'More styling in the Design Studio'
Margie replied to Phil McCluskey's discussion 'Site Manager Updates for Ning 3.0 Networks'
Thiago Santos de Moraes replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
Cindy replied to Allison Leahy's discussion 'What is your Ning 3.0 URL?' in the group The Sandbox© 2013 Created by Ning.
