Skip to Content Skip to Menu

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

  • liaskas
  • liaskas
  • ONLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 1 month 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 or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
7 years 1 month 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.

Code:
$_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.

Code:
$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 or Create an account to join the conversation.

  • liaskas
  • liaskas
  • ONLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 1 month 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum