@@ -52,7 +52,7 @@ public function getShowThread()
52
52
{
53
53
$ thread = App::make ('slugModel ' );
54
54
$ comments = $ this ->comments ->getThreadCommentsPaginated ($ thread , $ this ->commentsPerPage );
55
- $ this ->view ('forum.thread ' , compact ('thread ' , 'comments ' ));
55
+ $ this ->view ('forum.showthread ' , compact ('thread ' , 'comments ' ));
56
56
}
57
57
58
58
// create a thread
@@ -70,7 +70,6 @@ public function postCreateThread()
70
70
'title ' => Input::get ('title ' ),
71
71
'body ' => Input::get ('body ' ),
72
72
'author_id ' => Auth::user ()->id ,
73
- 'type ' => Comment::TYPE_FORUM ,
74
73
'laravel_version ' => Input::get ('laravel_version ' ),
75
74
'tags ' => $ tags ,
76
75
], new ForumThreadForm );
@@ -122,6 +121,7 @@ public function forumThreadUpdated($thread)
122
121
// bounces the user to the correct page of a thread for the indicated comment
123
122
public function getCommentRedirect ($ thread , $ commentId )
124
123
{
124
+ // refactor this
125
125
$ comment = Comment::findOrFail ($ commentId );
126
126
$ numberCommentsBefore = Comment::where ('parent_id ' , '= ' , $ comment ->parent_id )->where ('created_at ' , '< ' , $ comment ->created_at )->count ();
127
127
$ page = round ($ numberCommentsBefore / $ this ->commentsPerPage , 0 , PHP_ROUND_HALF_DOWN ) + 1 ;
@@ -167,13 +167,15 @@ public function getSearch()
167
167
{
168
168
$ query = Input::get ('query ' );
169
169
$ results = App::make ('Lio\Comments\ForumSearch ' )->searchPaginated ($ query , $ this ->threadsPerPage );
170
+
170
171
$ this ->view ('forum.search ' , compact ('query ' , 'results ' ));
171
172
}
172
173
173
174
// reply to a thread
174
175
public function postCreateReply ()
175
176
{
176
177
$ thread = App::make ('slugModel ' );
178
+
177
179
return App::make ('Lio\Forum\ForumReplyCreator ' )->create ($ this , [
178
180
'body ' => Input::get ('body ' ),
179
181
'author_id ' => Auth::user ()->id ,
@@ -185,7 +187,8 @@ public function getEditReply($replyId)
185
187
{
186
188
$ reply = $ this ->comments ->requireForumThreadById ($ replyId );
187
189
if (Auth::user ()->id != $ reply ->author_id ) return Redirect::to ('/ ' );
188
- $ this ->view ('forum.editcomment ' , compact ('reply ' ));
190
+
191
+ $ this ->view ('forum.editreply ' , compact ('reply ' ));
189
192
}
190
193
191
194
public function postEditReply ($ replyId )
0 commit comments