Skip to Content Skip to Menu

Need content variable of activity in onAfterCreateStreamComment

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
3 years 10 months ago #322626 by timstohr
Hi Kyle,
I would need the content variable of activity in onAfterCreateStreamComment.

Kind regards,

Tim

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48547
  • Thanks: 8290
  • Karma: 1445
3 years 10 months ago #322639 by krileon
Please check the below tutorial before asking this. It has been updated.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers

That triggers is as follows as noted in the above tutorial.

Code:
$_PLUGINS->trigger( 'activity_onAfterCreateStreamComment', array( $stream, $source, $row ) );

Feel free to post if you need clarity on a trigger variable as some variables are named a little vague. In the above for example var1 is the stream, var2 is the source object (if available) of the comment, and var3 is the comment.


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.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
3 years 10 months ago #322655 by timstohr
Hi Kyle, yes I had obviously checked the documentation already (you will see in PIWIK that site has been called like 20 times by me in the last two days) . I haven't got the slightest idea what you call your content variable (eg var2_content) which show what is inside the content of a comment/stream.

Also, do you call them always the same or not? I have seen [var2_id], [var2_user_id], [user_id] etc... all of these can (but do not have to) mean the user that has performed the action (ie the owner).

I am totally confused what I should call the content. It is clear that it is in var2 but what is the variable that is inside that variable that has the content of the activity in it?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48547
  • Thanks: 8290
  • Karma: 1445
3 years 10 months ago #322656 by krileon
The values inside of a variable depend entirely on the contents of the variable. I've no idea what the structure of var2 will be without knowing exactly when this is happening and where. It could be a comment object, activity object, group object, etc.. You have access to the full object of information, which you can check the structure directly in your database if you know what var2 is. For example if it's a group object you can access all the columns in _groupjive_groups.

Typically when commenting on an activity entry var2 is just going to be the activity object. This means var2 is access to all the columns in _comprofiler_plugin_activity. Most activity is processed PHP side and not in the database so you're going to have limited information available.


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