Пример #1
0
 /**
  * Create a wall activity for this user after posting a question.
  * 
  * @param CMA_AnswerThread $instance
  */
 static function thread_posted_activity(CMA_AnswerThread $instance)
 {
     if (!$instance->isPublished()) {
         return;
     }
     $post = $instance->getPost();
     $user_id = $instance->getAuthorId();
     $permalink = get_permalink($instance->getId());
     bp_activity_add(array('action' => sprintf(CMA::__('%s asked a new question: %s'), bp_core_get_userlink($user_id), sprintf('<a href="%s">%s</a>', esc_attr($permalink), esc_html($instance->getTitle()))), 'content' => $instance->getLightContent(), 'component' => self::COMPONENT, 'type' => 'thread_posted', 'primary_link' => $permalink, 'user_id' => $user_id, 'item_id' => $instance->getId()));
 }