Beispiel #1
0
 public static function get_list($limit, $page = 1, $self_member_id = 0)
 {
     $data = Model_Thread::get_pager_list(array('related' => 'member', 'where' => \Site_Model::get_where_params4list(0, $self_member_id), 'limit' => $limit, 'order_by' => array('created_at' => 'desc')), $page);
     $data['liked_thread_ids'] = conf('like.isEnabled') && $self_member_id ? \Site_Model::get_liked_ids('thread', $self_member_id, $data['list']) : array();
     return $data;
 }
Beispiel #2
0
 /**
  * Thread delete
  * 
  * @access  public
  * @params  integer
  * @return  Response
  */
 public function action_delete($id = null)
 {
     \Util_security::check_method('POST');
     \Util_security::check_csrf();
     try {
         \DB::start_transaction();
         $thread = Model_Thread::check_authority($id, $this->u->id);
         $thread->delete();
         \DB::commit_transaction();
         \Session::set_flash('message', term('thread') . 'を削除しました。');
     } catch (\FuelException $e) {
         if (\DB::in_transaction()) {
             \DB::rollback_transaction();
         }
         \Session::set_flash('error', $e->getMessage());
     }
     \Response::redirect('thread');
 }