Skip to Content Skip to Menu

Moderators for a specific group only

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
4 years 5 months ago #319297 by krileon
Replied by krileon on topic Moderators for a specific group only
Preferable an IDE of some kind. We use phpstorm, but any that supports PHP should be sufficient.


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.

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
4 years 5 months ago #319315 by eciudad
Replied by eciudad on topic Moderators for a specific group only
Thank you Kyle

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

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
4 years 4 months ago #319322 by eciudad
Replied by eciudad on topic Moderators for a specific group only
Thank you Kyle,

I reviewed it and this is beyond my level of comfort with modifying. I am comfortable with SQL scripts but I do not where to insert it in the users.php.

Let me explain what I have:

1. A table created by me (my_pointer_relevant) that among other thing has the following fields:
a. current_user field (login user)
b. member_user (members in different groups that would be relevant to the current_user)

2. My script: (used in other selections)

SELECT $user IN
(SELECT DISTINCT my.member_user
FROM my_pointer_relevant my
WHERE my.current_user = [user_id])
FROM CB\Database\Table\UserTable

note: this script the users that login user should be seeing while logged in despite of any other that might across (my goal is that despite of how users among groups, 10,000, 1 million, etc., the logged user would only deal with the relevant member in each group for which the user is a member instead of the entire population)

my question is where I should insert the short script to take advantage of substitution without limiting functionality? I do not know enough to see it this goes in users.php as I did not see SQL script in there.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
4 years 4 months ago #319332 by krileon
Replied by krileon on topic Moderators for a specific group only
Sorry, I don't think I understand exactly what you're trying to do here. Are you just wanting to display the results of that query as part of a users container under the Users tab in a GJ group? If that's the case your query is specific to a user and not a group so you should be able to pull that information using SQL in a Query field provided by CB Query Field. You'd then just use the below in CB Auto Actions to output it.

Global
Triggers: gj_onDisplayUser
Type: Code
User: Specific
Specific Variable: [var1_user_id]
Access: Everybody
Action
Method: HTML
Code:
Code:
[FIELD_NAME]
Output
Display: Silent
Layout:
Code:
$variables['var2'][] = $content;
Method: PHP
Parameters
Reference Variables: Variable 2

You can technically use this to output whatever you want since you can set the code action method to PHP and just output custom PHP per user container as well. Variable 2 is the $counters array in the template and what it's doing is just adding new counters to output to the footer of the user container.


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.

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
4 years 4 months ago #319334 by eciudad
Replied by eciudad on topic Moderators for a specific group only
Yes, it is user specific. Once the user logs in, that user should only see the members filtered, in all groups in which the user belongs and it could be extended to member list if possible, for now I am focusing in the groups

Question: Is the [FIELD_NAME], the name of CB Query field that I will be creating for the filtering purpose and if hidden from tab?

This is very powerful! I should contact you before!

Thank you

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
4 years 4 months ago #319336 by krileon
Replied by krileon on topic Moderators for a specific group only

Yes, it is user specific. Once the user logs in, that user should only see the members filtered, in all groups in which the user belongs and it could be extended to member list if possible, for now I am focusing in the groups

That's not possible in CB GroupJive without ideally modifying the query used for the Users tab, which is only doable by making core code changes that I can not help you with. I don't have anything further to suggest in this regard. There are no plans for such functionality either. That tab is intended to show the users who have joined that group.

It should be perfectly doable for a userlist however since you can add custom database query filters to it by setting filtering to Advanced, which directly adds whatever SQL you provide to the WHERE statement of the userlist query.

Question: Is the [FIELD_NAME], the name of CB Query field that I will be creating for the filtering purpose and if hidden from tab?

Yes FIELD_NAME would be the name of your query field, but it is not a filter. It just displays the field in the users container under the Users tab. You were not clear on what you were asking for so my suggestion has nothing to do with filtering the users.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum