Skip to Content Skip to Menu

[SOLVED] Automatically upgrade GroupJive members on joining a group based on usergroup

  • LineMine
  • LineMine
  • OFFLINE
  • Posts: 160
  • Thanks: 22
  • Karma: 6
7 years 1 month ago - 7 years 1 month ago #297049 by LineMine
Hi

I would like to know if it is possible to automatically upgrade a user who is in a particular Joomla usergroup, to Moderator status when they join any GroupJive group.

I am using the Moderator status to distinguish types of user from other group members, and currently Admin has to promote users manually.

I can see that some actions are possible using Auto Actions and combining gj_onAfterJoinGroup and gj_onAfterUpdateUser, so I'm hoping this one is also possible?

Thanks
Last edit: 7 years 1 month ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
7 years 1 month ago - 7 years 1 month ago #297068 by krileon
Yes, that's possible. You will have to use a Query to do that though since the GroupJive action has no usecase for changing status (have added a feature ticket to implement this). You'd create a Query action acting on gj_onAfterJoinGroup as follows.

Global
Triggers: gj_onAfterJoinGroup
Type: Query
User: Automatic
Access: select your usergroup here that you want this to apply to
Action
Query:
Code:
UPDATE `#__groupjive_users` SET `status` = 2 WHERE `id` = '[var1_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.
Last edit: 7 years 1 month ago by krileon.
The following user(s) said Thank You: LineMine

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

  • LineMine
  • LineMine
  • OFFLINE
  • Posts: 160
  • Thanks: 22
  • Karma: 6
7 years 1 month ago #297099 by LineMine
Hi
pretty sure I've set this up correctly, but I'm getting this error message;

An 1146 error occured during your request.

The Join request goes ahead, the user is added to a group but not promoted to Moderator.

Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
7 years 1 month ago #297123 by krileon
Your database table prefix probably isn't jos_. I've edited the sample code replacing jos_ with #_ to work with any table. Please retry.


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: LineMine

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

  • LineMine
  • LineMine
  • OFFLINE
  • Posts: 160
  • Thanks: 22
  • Karma: 6
7 years 1 month ago #297127 by LineMine
Brilliant, that works, thank you.

I did notice the "jos"prefix in there in fact, when I got an error, and tried changing it to my database prefix, but still got the error message. I'm going to check I got the prefix right, as it should work, shouldn't it?

Thank you as well for adding this as a feature ticket.
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum