[#6809] Here is another case we try to set but we are stuck.

6 years 6 months ago #298032 by liaskas
Ok...

Is there a way to have the comments unpublished by default?

Or is there a way to create an auto action that will unpublish the comments after creation?

Thank you.

Please Log in to join the conversation.

6 years 6 months ago #298033 by krileon

Is there a way to have the comments unpublished by default?

No.

Or is there a way to create an auto action that will unpublish the comments after creation?

Yes, you can use activity_onBeforeCreateStreamComment to modify the reference comment variable and change the published variable of the comment object. The trigger is as follows.

$_PLUGINS->trigger( 'activity_onBeforeCreateStreamComment', array( $stream, $source, &$row ) );

This means using a code action you can modify var3 by reference (you need to set this variable as a reference under Parameters). Example PHP as follows.

$variables['var3']->set( 'published', 0 );


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

Please Log in to join the conversation.

6 years 6 months ago #298038 by liaskas
This worked fine.

Also created an auto action to notify moderators by mail about the new comment and everything is ok. Thank you again for your help.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.231 seconds

Facebook Twitter LinkedIn