Forum #2
|
@ -95,7 +95,7 @@ class BoardController extends Controller {
|
|||
->count();
|
||||
}
|
||||
|
||||
public function getTopic($id, $from, $to) { // /api/rpc/board/forum/gettopics/id/from/to
|
||||
public function getTopic($id, $from, $to) { // /api/rpc/board/topic/gettopic/id/from/to
|
||||
return DB::table('for_threads')
|
||||
->select('*')
|
||||
->where('id', $id)
|
||||
|
@ -104,4 +104,105 @@ class BoardController extends Controller {
|
|||
->orderBy('last_date', 'desc')
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getTopicLock($id) { // /api/rpc/board/topic/gettopiclock/id
|
||||
return DB::table('for_threads')
|
||||
->select('lock')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getTopicName($id) { // /api/rpc/board/topic/gettopicname/id
|
||||
return DB::table('for_threads')
|
||||
->select('for_id', 'title')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getPostsInTopic($top_id, $from, $to) { // /api/rpc/board/post/getpostsintopic/top_id/from/to
|
||||
return DB::table('for_posts')
|
||||
->select('*')
|
||||
->where('top_id', $top_id)
|
||||
->offset($from)
|
||||
->limit($to)
|
||||
->orderBy('post_date', 'asc')
|
||||
->get();
|
||||
}
|
||||
|
||||
public function countPostsInTopic($top_id) { // /api/rpc/board/post/countpostsintopic/top_id
|
||||
return DB::table('for_posts')
|
||||
->where('top_id', $top_id)
|
||||
->count();
|
||||
}
|
||||
|
||||
public function getPost($id) { // /api/rpc/board/post/getpost/id
|
||||
return DB::table('for_posts')
|
||||
->select('*')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getUserPosts($top_id, $from, $to) { // /api/rpc/board/post/getuserposts/top/from/to
|
||||
return DB::table('for_posts')
|
||||
->join('for_users', 'for_posts.user_id', '=', 'for_users.id')
|
||||
->where('for_posts.top_id', $top_id)
|
||||
->offset($from)
|
||||
->limit($to)
|
||||
->orderBy('for_posts.post_date', 'asc')
|
||||
->get(array(
|
||||
"for_posts.id",
|
||||
"top_id",
|
||||
"user_id",
|
||||
"post_date",
|
||||
"message",
|
||||
"delete",
|
||||
"lastedit",
|
||||
"ipaddress",
|
||||
"delreason",
|
||||
"nolayout",
|
||||
"postcount",
|
||||
"username",
|
||||
"perm_id",
|
||||
"total_posts",
|
||||
"header",
|
||||
"footer",
|
||||
"member_title",
|
||||
"gender",
|
||||
"avatar",
|
||||
"name_colour",
|
||||
"display_name",
|
||||
"country"
|
||||
));
|
||||
}
|
||||
|
||||
public function getUserPost($id) { // /api/rpc/board/post/getuserpost/id
|
||||
return DB::table('for_posts')
|
||||
->join('for_users', 'for_posts.user_id', '=', 'for_users.id')
|
||||
->where('for_posts.id', $id)
|
||||
->orderBy('for_posts.post_date', 'asc')
|
||||
->get(array(
|
||||
"for_posts.id",
|
||||
"top_id",
|
||||
"user_id",
|
||||
"post_date",
|
||||
"message",
|
||||
"delete",
|
||||
"lastedit",
|
||||
"ipaddress",
|
||||
"delreason",
|
||||
"nolayout",
|
||||
"postcount",
|
||||
"username",
|
||||
"perm_id",
|
||||
"total_posts",
|
||||
"header",
|
||||
"footer",
|
||||
"member_title",
|
||||
"gender",
|
||||
"avatar",
|
||||
"name_colour",
|
||||
"display_name",
|
||||
"country"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,13 @@ class UserController extends Controller {
|
|||
->get();
|
||||
}
|
||||
|
||||
public function getPostStyle($id) { // /api/rpc/user/user/getpoststyle/id
|
||||
return DB:: table('for_users')
|
||||
->select('header', 'footer')
|
||||
->where('id', $id)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function getGroupColours() { // /api/rpc/user/user/getgroupcolours
|
||||
return DB::table('usr_perm_module')
|
||||
->select(
|
||||
|
|
|
@ -25,4 +25,13 @@ Route::get('/api/rpc/board/topic/gettopics/{cat}/{from}/{to}', 'BoardController@
|
|||
Route::get('/api/rpc/board/topic/gettopicsunpinned/{cat}/{from}/{to}', 'BoardController@getTopicsUnpinned');
|
||||
Route::get('/api/rpc/board/topic/gettopicspinned/{cat}', 'BoardController@getTopicsPinned');
|
||||
Route::get('/api/rpc/board/topic/countunpinnedtopicsinforum/{for_id}', 'BoardController@countUnpinnedTopicsInForum');
|
||||
Route::get('/api/rpc/board/topic/gettopic/{cat}/{from}/{to}', 'BoardController@getTopic');
|
||||
Route::get('/api/rpc/board/topic/gettopic/{cat}/{from}/{to}', 'BoardController@getTopic');
|
||||
Route::get('/api/rpc/board/topic/gettopiclock/{id}', 'BoardController@getTopicLock');
|
||||
Route::get('/api/rpc/board/topic/gettopicname/{id}', 'BoardController@getTopicName');
|
||||
|
||||
// Post
|
||||
Route::get('/api/rpc/board/post/getpostsintopic/{top}/{from}/{to}', 'BoardController@getPostsInTopic');
|
||||
Route::get('/api/rpc/board/post/countpostsintopic/{top}', 'BoardController@countPostsInTopic');
|
||||
Route::get('/api/rpc/board/post/getpost/{id}', 'BoardController@getPost');
|
||||
Route::get('/api/rpc/board/post/getuserposts/{top}/{from}/{to}', 'BoardController@getuserPosts');
|
||||
Route::get('/api/rpc/board/post/getuserpost/{id}', 'BoardController@getuserPost');
|
|
@ -24,4 +24,5 @@ Route::get('/api/rpc/user/owner/getfilesofowner/{id}', 'OwnerController@getFiles
|
|||
// User
|
||||
Route::get('/api/rpc/user/user/getusers', 'UserController@getUsers');
|
||||
Route::get('/api/rpc/user/user/getuser/{id}', 'UserController@getUser');
|
||||
Route::get('/api/rpc/user/user/getpoststyle/{id}', 'UserController@getPostStyle');
|
||||
Route::get('/api/rpc/user/user/getgroupcolours', 'UserController@getGroupColours');
|
||||
|
|
新しいイシューから参照