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.

Tags: groups, rss, tags

Views: 84

Reply to This

Replies to This Discussion

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

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.

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.

The page does not exist yet.. I'm just thinking out loud. I think it's preferable to do all this in its own page instead of affecting the entire sites display of "my groups". 

I've sent you a friends request so I can PM you more about this. 

RSS

Latest Activity


NC for Hire
JFarrow replied to John Bizley's discussion 'A few adjustment for your video feed player in your social channels page.'
"you too Bernard, of course."
2 hours ago

NC for Hire
JFarrow replied to John Bizley's discussion 'A few adjustment for your video feed player in your social channels page.'
"nice work and terrific share.  John you're appreciated!"
2 hours ago

NC for Hire
JFarrow replied to SM's discussion 'Just discovered Disqus commenting on Ning - how do we add more features?'
"they do.  it's call like.  i changed mine to 'promote'  which of…"
3 hours ago
soaringeagle replied to soaringeagle's discussion 'google disavow 101'
"i have for 2 days been tackling this list for many hours a day and the scrollbars barely moved from…"
3 hours ago
Jelena replied to israel's discussion 'Pantalla de Administrador o Creador (Manage'
"el 2.0 es diferente a ning 3.0  y tu sitio es un ning 3.0 por ahora nadie puede integrar…"
4 hours ago
Rosas † Negras shared a profile on Twitter
4 hours ago
Rosas † Negras replied to OneCrow's discussion 'Navigation For Our Network'
"lol"
4 hours ago
Rosas † Negras favorited caro's profile
4 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service