Agora Groups

14 years 5 months ago #116885 by iamalive
Agora Groups was created by iamalive
Hi again
I am using CBsubs to provide paid access to material on a website I'm building. One part of that is the Agora forum for users of specific groups. However at the moment I have to assign new subscribers manually to the specific Agora Group.

CBsubs offers a method of executing SQL commands when a new user registers. I believe that this could be used to autoassign new users to an Agora Group automatically, based on the subscription which they have acquired. Similarly, they can be unsubscribed when their subscription has run out.

My problem is that I am not a developer and have no idea how to write such a script to add to the CBsubs SQL plugin.

Can anyone here help me?

Regards
David

Please Log in to join the conversation.

14 years 5 months ago #116962 by krileon
Replied by krileon on topic Re:Agora Groups
I suggest examining your database to see how Agoras tables are structured then build a query based off this. Please review various other threads pertaining to SQL Actions usage for examples on how to build queries. I've never used Agora so have no further advise unfortunately.


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 to join the conversation.

14 years 4 months ago #119904 by nant
Replied by nant on topic Re:Agora Groups
With Kyle's assistance I am proposing the following SQL script to add a user to an Agora group:

Code to add user to agora group with group_id=GID (GID should be an integer number - check table jos_agora_groups for your specific agora group) with role_id=RID (RID should be an integer number - check jos_agora_roles for your specific role - usually role_id of 2 is used for member)

[code:1]
INSERT INTO `#__agora_user_group` ( `user_id`, `group_id`, `role_id` ) VALUES ( ( SELECT `id` FROM `#__agora_users` WHERE `jos_id` = [user_id] ), 'GID', 'RID' )
[/code:1]

and remove code should look like:

[code:1]
DELETE FROM `#__agora_user_group` WHERE ( (`group_id` = 'GID') AND (`role_id` = 'RID') AND (`user_id` = (SELECT `id` FROM `#__agora_users` WHERE `jos_id` = [user_id] ) ) )
[/code:1]

Please backup and test first.

Post edited by: nant, at: 2009/12/22 17:55

Please Log in to join the conversation.

14 years 3 months ago #120016 by iamalive
Replied by iamalive on topic Re:Agora Groups
Hi Nant

Thanks for the input. I'll be trying that out over the next few days - that's what Christmas is for isn't it? :-)

I really appreciate it.

Regards
David

Please Log in to join the conversation.

14 years 3 months ago #120040 by nant
Replied by nant on topic Re:Agora Groups
iamalive wrote:

Hi Nant

Thanks for the input. I'll be trying that out over the next few days - that's what Christmas is for isn't it? :-)

I really appreciate it.

Regards
David


yup, merry xmas!

hohoho

please let us know how it works

Please Log in to join the conversation.

14 years 5 days ago #130516 by Bob Sinclair
Replied by Bob Sinclair on topic Re:Agora Groups
Does this integration of CBSubs and Agora work? If so, should the cbagora plugin be installed?

Thanks!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.237 seconds