Skip to Content Skip to Menu

CB Auto Actions Code

  • nooran
  • nooran
  • OFFLINE
  • Posts: 17
  • Thanks: 0
  • Karma: 0
10 years 9 months ago #240363 by nooran
CB Auto Actions Code was created by nooran
Hello,

I want to use some PHP code in the CB Auto Actions Code. I want change value of one CB field after user profile updated.

I try to put this code:

<?php
$HostName='***';
$DBName='***';
$DBUserName='***';
$DBPass='***';
$con=mysql_connect(***,***,***,***);

$strSqlUpdateLink="UPDATE jum2593_comprofiler
SET cb_web=' www.yahoo.com '
WHERE id = [user_id]";
mysql_query($con,$strSqlUpdateLink);
?>

"cb_web" is field as web address type, and I set triggers as "onAfterUserUpdate,onAfterUpdateUser".

but it doesn't have effect.

Many thanks

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 9 months ago #240371 by nant
Replied by nant on topic CB Auto Actions Code
Is there a reason you are not using a CB Field action directly?

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

  • nooran
  • nooran
  • OFFLINE
  • Posts: 17
  • Thanks: 0
  • Karma: 0
10 years 9 months ago #240373 by nooran
Replied by nooran on topic CB Auto Actions Code
Thanks for reply
I used Query action and I could updated CB field, but now I want call "Direct Admin Api" with parameters after user profile updated.Is there any way?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #240389 by krileon
Replied by krileon on topic CB Auto Actions Code
Don't understand the question. What is "Direct Admin Api"? To change a fields value simply use the Field action as Nick suggested.


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.

  • nooran
  • nooran
  • OFFLINE
  • Posts: 17
  • Thanks: 0
  • Karma: 0
10 years 9 months ago #240413 by nooran
Replied by nooran on topic CB Auto Actions Code
Thanks for your suggest.
I have php file that this get dynamic parameters and connect to API and execute it. I used Redirect CB action and all things were OK but I don't want my user redirect to another page and this happen in background or CB action call my php code.
Thanks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #240434 by krileon
Replied by krileon on topic CB Auto Actions Code
Use a Code action with Method set to PHP then you can execute whatever PHP you want.


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