Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

[#3622] Add to K2 user group with CBsubs

  • activha
  • activha
  • ONLINE
  • Posts: 2334
  • Thanks: 117
  • Karma: 13
12 years 5 months ago - 12 years 3 months ago #203061 by activha
Hello

I would like to add and remove new and old users to K2user groups depending on the plan subscribed with CBsubs

I did not see any integration with K2, is there any mean to achieve this easily ?

Thanks in advance
Last edit: 12 years 3 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48570
  • Thanks: 8293
  • Karma: 1445
12 years 5 months ago #203106 by krileon
Replied by krileon on topic Re: Add to K2 user group with CBsubs
I believe a user can only have 1 group and that group id is added to the "group" column in _k2_users. You could use CBSubs SQL Actions to query this table and change that group.


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.

  • activha
  • activha
  • ONLINE
  • Posts: 2334
  • Thanks: 117
  • Karma: 13
12 years 4 months ago #206497 by activha
Replied by activha on topic Re: Add to K2 user group with CBsubs
Thanks
I have some problem with the sql query.

I try to use this one
Code:
IF (userID > 0 ) THEN UPDATE yq0g1_k2_users SET userName = [USERNAME], group = '3' WHERE userID = [user_id] ELSE INSERT INTO yq0g1_k2_users(id,userID,userName,group) VALUE(id+1,[user_id],[USERNAME],'3') END IF

but it does not work.
Could you help me on this ?

thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48570
  • Thanks: 8293
  • Karma: 1445
12 years 4 months ago #206572 by krileon
Replied by krileon on topic Re: Add to K2 user group with CBsubs
It's malformed, you've no quotes. Please review the below MYSQL documentation for formatting help.

dev.mysql.com/doc/refman/5.6/en/index.html

You can also review the below SQL tutorials for further information.

www.w3schools.com/sql/default.asp


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.

  • activha
  • activha
  • ONLINE
  • Posts: 2334
  • Thanks: 117
  • Karma: 13
12 years 4 months ago #206611 by activha
Replied by activha on topic Re: Add to K2 user group with CBsubs
Thanks Kyle but I am not a developper, just trying to make something as you don't have proper integration with K2 and it is impossible to add a user to K2 group when using CB !

Please could you help me on this one and correct my awrful try ?? ;-)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48570
  • Thanks: 8293
  • Karma: 1445
12 years 4 months ago #206662 by krileon
Replied by krileon on topic Re: Add to K2 user group with CBsubs

Thanks Kyle but I am not a developper, just trying to make something as you don't have proper integration with K2 and it is impossible to add a user to K2 group when using CB !

With CB integration enabled in K2 and CB Articles installed to CB and set to K2 you don't need K2s users table, it won't be used for display anywhere. The integration is "proper" and complete, we've communicated well with the K2 team to ensure it was.

K2 groups aren't needed to establish permissions to K2 tasks, see K2 > Parameters > Permissions and you can assign permissions to Joomla usergroups. K2 groups are basically there as before J2.5 such feature wasn't available.

Please could you help me on this one and correct my awrful try ??

Below should do the trick.
Code:
INSERT INTO `#__k2_users` ( `userID`, `userName`, `group` ) VALUES ( '[user_id]', '[USERNAME]', 3 ) ON DUPLICATE KEY UPDATE `userName` = '[USERNAME]', `group` = 3;


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