Referencing things

I am trying to make a part of my website list all of my groups that a user is in. I would just like all of the names listed under something called "My Groups". Is there such a way to access then group names and do this?

Quote · 5 Aug 2013

not sure if there is a default way for this - but if not, you could probably use a php block with an sql query.

caredesign.net
Quote · 5 Aug 2013

How do I do that? I don't think i'm able to just run a query from the page block 

Quote · 5 Aug 2013

Yes, very easy.  I have a block on the account page that lists all the groups that a member belongs to.  It would need to be on the account or profile page so that it can access the member's ID.  If you wanted a block on the home page that would list each group a member belongs to, then that requires a bit of extra coding; you would need to get the members list, then go and look up the groups that the member belongs to.  You would then create the pagination for the block.  I have two blocks on the account page, one is My Groups, and the other is "Groups I Belong To"

What is it exactly that you wish?

Geeks, making the world a better place
Quote · 5 Aug 2013

 

How do I do that? I don't think i'm able to just run a query from the page block 

Yes, you can.  A php page block contains code, including sql queries.

Geeks, making the world a better place
Quote · 5 Aug 2013

 

Yes, very easy.  I have a block on the account page that lists all the groups that a member belongs to.  It would need to be on the account or profile page so that it can access the member's ID.  If you wanted a block on the home page that would list each group a member belongs to, then that requires a bit of extra coding; you would need to get the members list, then go and look up the groups that the member belongs to.  You would then create the pagination for the block.  I have two blocks on the account page, one is My Groups, and the other is "Groups I Belong To"

What is it exactly that you wish?

  Thx. Would you mind posting ur code for the "Groups I Belong To" block? That is exactly what i'm looking for.

Quote · 6 Aug 2013

Sure.

Geeks, making the world a better place
Quote · 6 Aug 2013

@GG - the same script you are using for the account page should work on the home page if you use the memberID cookie - this way it would always pull in the list of the member who is currently logged in. If I am not mistaken.

caredesign.net
Quote · 6 Aug 2013

Do you know how to add a php block to a page?  There are a couple of free modules in the Market that can handle it from the back end, one from the page builder.  The other way is to edit the database.

Geeks, making the world a better place
Quote · 6 Aug 2013

 

@GG - the same script you are using for the account page should work on the home page if you use the memberID cookie - this way it would always pull in the list of the member who is currently logged in. If I am not mistaken.

 I think it just works off of the ID that is already known through the account page.

Geeks, making the world a better place
Quote · 6 Aug 2013

@GG - you could create a variable - the cookie for the member is stored when the user logs in. So something like:

 

$my_id = $_COOKIE['memberID'];

you could then use the $my_id variable in your sql query. And essentially put it on any page that you wanted to.

caredesign.net
Quote · 6 Aug 2013

Actually, I just copied this since it already existed and placed a php block on the account page with that code.  I created a new language key,_bx_groups_block_groups_joined and entered Groups I Belong To.

 

bx_import('BxDolService'); return BxDolService::call('groups', 'profile_block_joined', array($this->oProfileGen->_iProfileID));

 

So now on the account page you have a block with the title, "Groups I Belong To" that will list all the groups that you belong to.  My members wanted the list on their account page to aid in seeing which groups they have joined.  I did not do anything new except copy the code from one place to another.

Geeks, making the world a better place
Quote · 6 Aug 2013

thhis would allow you to place itr on any page:

 

$my_id = $_COOKIE['memberID'];


bx_import('BxDolService'); return BxDolService::call('groups', 'profile_block_joined', array($my_id));

caredesign.net
Quote · 6 Aug 2013

 

thhis would allow you to place itr on any page:

 

$my_id = $_COOKIE['memberID'];


bx_import('BxDolService'); return BxDolService::call('groups', 'profile_block_joined', array($my_id));

Any pages except the profile. Because this method will return groups for the logged in user and not the user whos profile is being viewed.


https://www.deanbassett.com
Quote · 6 Aug 2013

 

 

thhis would allow you to place itr on any page:

 

$my_id = $_COOKIE['memberID'];


bx_import('BxDolService'); return BxDolService::call('groups', 'profile_block_joined', array($my_id));

Any pages except the profile. Because this method will return groups for the logged in user and not the user whos profile is being viewed.


 How would I make it for the user that i'm viewing?

Quote · 6 Aug 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.