| 
Welcome, Guest
  • Page:
  • 1

TOPIC: Switch code on trigger in auto action

Switch code on trigger in auto action 1 year 1 month ago #195996

  • adop
  • adop
  • OFFLINE
  • Senior Boarder
    Senior Boarder
  • Posts: 51
  • Karma: -
Borrowing from some lines of code that I found in another post I am trying to get this auto action to work.

This is the trigger:
$_PLUGINS->trigger( 'gj_onAfterJoinGroup', array( $row, $group, $category, $user, $plugin ) );
for which I am trying to get this flow to work:
$newId =$ $group->id;
Switch ($newId) {
 
case 169:
$return_url = 'index.php?option=com_content&view=article&id=70&Itemid=401';
break;
case 170:
$return_url = 'index.php?option=com_content&view=article&id=71&Itemid=402';
break;
default:
}
Any help is appreciated.

Regards,

adop
J2.5.3 CB 1.8.0 GJ 2.5.1 Kunena 1.7.2
The administrator has disabled public write access.

Re: Switch code on trigger in auto action 1 year 1 month ago #196051

  • krileon
  • krileon
  • OFFLINE
  • Moderator
    Moderator
  • Posts: 31427
  • Karma: 897
Don't understand what you're trying to do. Are you trying to redirect based off what group a user joins? You can do this with a simple condition in a Redirect action. Examples as follows

[var2_id] Equal To 169

You'd create multiple redirect actions with the conditions adjusted as necessary.
Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Tutorials + Search the forums
CB links: Documentation - Tutorials - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Advanced, Professional, Developer, or CBSubs 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 Advanced, 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 EST to 4:00 PM EST. 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.
--
If you use Community Builder, please post a rating and a review at the Joomla! Extensions Directory.
The administrator has disabled public write access.
The following user(s) said Thank You: adop
  • Page:
  • 1
Time to create page: 0.285 seconds