Display groups in members list & profile

12 years 4 weeks ago #197793 by smoothound
Display groups in members list & profile was created by smoothound
Hi

I am in the process of of upgrading Joomla from 1.5 to 2.5
I have created several user groups eg "club sponsors" "club members" etc and would like to know if I display the group for each member in the members list and profile.

Thanks

Please Log in to join the conversation.

12 years 4 weeks ago #197851 by krileon
Replied by krileon on topic Re: Display groups in members list & profile
CB only has substitutions to display the IDs of those groups. To display the titles, I assume comma separated, you'd need to use CB Query Field for example to query the database for their usergroups and parse them into titles. Query is as follows (built on J2.5 for CB Query Field).
SELECT GROUP_CONCAT( b.`title` ) AS grps FROM `#__user_usergroup_map` AS a LEFT JOIN `#__usergroups` AS b ON b.`id` = a.`group_id` WHERE a.`user_id` = '[user_id]' GROUP BY a.`user_id`


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: pepperstreet

Please Log in to join the conversation.

12 years 4 weeks ago #197870 by smoothound
Replied by smoothound on topic Re: Display groups in members list & profile
Thanks for the code krileon.
I have tried to create a new field but have not been able to get it to work.
Any chance of a quick idiots guide (probably putting the code in the wrong place).

Thanks

Please Log in to join the conversation.

12 years 4 weeks ago #197878 by krileon
Replied by krileon on topic Re: Display groups in members list & profile
You need to have CB Query Field (incubator project) installed. Leave all the parameters as default then just copy and paste the query above into the Query of the field and you're done.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: smoothound

Please Log in to join the conversation.

12 years 4 weeks ago #197892 by smoothound
Thats done the trick
Works perfectly
Thank you :)

Please Log in to join the conversation.

12 years 4 weeks ago #197893 by pepperstreet
Replied by pepperstreet on topic Re: Display groups in members list & profile
Regarding performance and the extra query...

What about using a Delimiter field with IF statements and just checking for the "gid". Then output a respective text or even an image.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.217 seconds

Facebook Twitter LinkedIn