Hi ning folk!
I would like to be able to parse the list of groups a member has joined and display it. For example going to my groups (e.g. http://creators.ning.com/groups/group/listForContributor?user=angel...) shows all the groups I am a member of, but is there a way to parse this output (e.g. only display groups the groups I have joined that begins with "London")
Is there a a programmable way to do this, either via the URL or otherwise?
I would like to be able to automatically display all the groups a member belonged to that has a specific phrase in it. In the absence of group tags I'm not sure how I can do this.
yes there's a way to do it using jQUery , here's the code:
<script type="text/javascript">
if(window.location.href.indexOf("group/listForContributor") >= 0){
//users on my groups page
x$('.xg_list_groups_main li .bd .tb h3 a').each(function(){
var link = x$(this).attr('href');
if(link.indexOf('London') >=0){
}
else{
x$(this).parent().parent().parent().parent().css('display','none');
}
});
}
else{
//users NOT on my groups page so do nothing here
}
</script>
put this into your "Cusom Code" box of your network. and if you want to add multiple words to parse.
you can add a || javascript "or" operator like this:
if(link.indexOf('London') >=0 || link.indexOf('somethingelse') >=0 ){
That's all hope it helps
Permalink Reply by Melon on December 26, 2011 at 5:04am Thanks Elson, looks like great approach! You seem to be a bit of a whiz.
Unfortunately I cannot get it to work. I have added the code and edited the line if(link.indexOf('London') >=0){ replacing London with the exact name of a group. When I save & refresh and go to my groups no groups show at all.
Any ideas?
Also, would it be possible to implement a wildcard solution with this? E.g. Groups London*
it should work , may i know the exact name? because you may accidentally removed the quotes.
btw , i'm not sure what a wildcard is . but i would love to know what is it so i can help you with it.
Permalink Reply by Melon on December 26, 2011 at 5:16am Aha, yes, my mistake, a quote was missing. Thanks!
By wildcard I mean instead of displaying a specific group it displayed all groups that begun with "London". So for example if the following if groups called "London Tube" or "London Museum" existed it would display those too.
Is there a way to do all this on a Ning page instead of manipulating the My Groups output? i.e. have a ning page that displayed groups joined that had specific names (e.g. "London")
Thanks a lot for your help
yes, but i will need to look at that page's html code so i can write a script for that.




soaringeagle replied to soaringeagle's discussion 'google disavow 101'
Jelena replied to israel's discussion 'Pantalla de Administrador o Creador (Manage'© 2013 Created by Ning.
