title: How to add a custom event item in Buddypress Activity Stream?
body: <p>Does anybody know the basic steps on how to add a custom event item to the Buddypress activity stream? I've got a custom post type of "activity" that my members can click on in the post and it records in a database table that that user has "completed" that activity. More or less like a "to do" list. I'm trying to figure out how I can integrate this with the buddypress activity stream so when a user clicks the button, it inserts something like, "John Doe has completed Permalinked Post Title Here." I've looked through the Buddypress codex &amp; have Googled quite a bit, but I can't seem to find any good tutorials on this. If anybody can point me in the right direction or give me a simple plain English step by step I would appreciate it. Please know that I'm not looking for any code written, just a general idea of the steps involved in making this happen. </p>
  
  <p>For anyone who is searching, this is what I wrote in my php file that was called in the ajax request for the button that "completes" the activity...</p>
  
  <pre><code>// Begin Code for Custom Activity Stream
  global $wp, $wp_query;
  $this_activity_object = get_post( $activity_post_id_complete ); 
  $title = $this_activity_object-&gt;post_title; 
  $activity_content = $title;
  $this_user_profile_url = bp_core_get_user_domain($wp_user_id);  
  $action_String = "&lt;a href=\"". $this_user_profile_url ."\"&gt;@" . bp_core_get_username($wp_user_id)."&lt;/a&gt; just completed a custom activity!";
  
  global $bp;
  bp_activity_add( array(     
      'user_id' =&gt; $wp_user_id,
      'item_id' =&gt; $activity_db_id_complete,
      'action' =&gt; $action_String,
      'content' =&gt; $activity_content,
      'component' =&gt; 'activity',
      'primary_link' =&gt; '&lt;a href="'.get_post_permalink($this_activity_id).'"&gt;' . $title . '&lt;/a&gt;',
      'type' =&gt; 'custom_activity_update',
      'hide_sitewide' =&gt; false
  ));
  </code></pre>