Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

How do I make a list of all the admins of GJ groups?

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
9 years 1 month ago #270031 by timstohr
Hey

In order to solve the above, I was thinking of promoting the admins of GJ groups into a separate ACL. I am aware that auto actions is the best thing to use in this case, I was just wondering how best to do it?

At the end of the day, what I want is to have a list with all admins and moderators as well as to put some kind of badge on their profile picture (I know how to do that as long as they are in a separate ACL/have some field in CB activated).

Another idea would be to have a field in CB profile set to YES if they are admin (I can take it on from there to put them in different ACL and do the rest of the changes needed)

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
9 years 1 month ago #270087 by krileon
You don't need ACL for that. For the list you can use a userlist with an Advanced filter to filter it down to only group owners. Next for the badge you can use a CB Query Field to check if they're a group owner then condition the query field using a substitution IF statement to output a badge of some sort. No need for extra ACL. If you still want the ACL you'd just condition the query field in your auto action to determine if they should have your usergroup or not. The below queries should do what you're wanting.

Userlist Advanced Filter:
Code:
( ( SELECT COUNT(*) FROM `#__groupjive_users` AS gu WHERE gu.`user_id` = u.`id` AND gu.`status` = 4 ) > 0 )

CB Query Field:
Code:
SELECT COUNT(*) FROM `#__groupjive_users` WHERE `user_id` = '[user_id]' AND `status` = 4


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.

Please Log in or Create an account to join the conversation.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
9 years 1 month ago - 9 years 1 month ago #270126 by timstohr
Ok thanks. I am starting to understand it. Just one more thing: moderator= status 2 , admin = status 3, group owner= status 4 no?

Second question: Is it also possible to have in the list the name of the group that they are owner, admin etc... ? Maybe have a link to that group as well?

I cant find the button for this nor can I find a way to do it... Maybe Query field and then showing the Query field in the list? Any simple way to do that?
Last edit: 9 years 1 month ago by timstohr.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
9 years 1 month ago - 9 years 1 month ago #270145 by krileon

Ok thanks. I am starting to understand it. Just one more thing: moderator= status 2 , admin = status 3, group owner= status 4 no?

Yes, all the status are as follows.

-1 = Banned
0 = Pending
1 = Active
2 = Moderator
3 = Admin
4 = Owner

Second question: Is it also possible to have in the list the name of the group that they are owner, admin etc... ? Maybe have a link to that group as well?

You'd need a CB Query Field set to output multiple rows for that, but yes it's doable. Example as follows.

Query:
Code:
SELECT g.`id`, g.`category`, g.`name` FROM `#__groupjive_users` AS u LEFT JOIN `#__groupjive_groups` AS g ON g.`id` = u.`group` WHERE u.`user_id` = '[user_id]' AND u.`status` = 4
Output: Multiple Rows
Row:
Code:
<div><a href="index.php?option=com_comprofiler&view=pluginclass&plugin=cbgroupjive&action=groups&func=show&cat=[column_category]&grp=[column_id]">[column_name]</a></div>


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.
Last edit: 9 years 1 month ago by krileon.

Please Log in or Create an account to join the conversation.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
9 years 1 month ago #270164 by timstohr
Thanks, very very helpful. I did not know that you could have a multiple row output of CbQuery. Opens new ideas...

I will have to get into reading up on CBQuery and will then post the final product here in case other people want to read up on it.
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
9 years 1 month ago #270239 by timstohr
Hey,

Your query is wrong. I got a 1054 error.

I had a look in the table and found out that the group category is in another table (furthermore there is no NAME in the table #__groupjive_users).

How do I add it in there that it should SELECT from #__groupjive_users the ID and group_ID and then fetch the corresponding "Category" from #__groupjive_groups?

PS: I am starting to get it...

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum