コード例 #1
0
ファイル: create.php プロジェクト: andrewkrug/repucaution
 public function post_video($post)
 {
     if ($this->template->is_ajax()) {
         $post['post_to_groups'] = array($this->profile->id);
         $post['timezone'] = User_timezone::get_user_timezone($this->c_user->id);
         $post['user_id'] = $this->c_user->id;
         $post['title'] = 'from ' . get_instance()->config->config['OCU_site_name'];
         $errors = Social_post::validate_post($post);
         if (empty($errors)) {
             $this->load->library('Socializer/socializer');
             Social_post::post_video($post, $this->c_user->id, $this->profile->id);
             $result['success'] = true;
             $result['message'] = lang('post_was_successfully_added');
         } else {
             $result['success'] = false;
             $result['errors'] = $errors;
         }
         echo json_encode($result);
     }
     exit;
 }