mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-30 07:20:25 -05:00
(Update) Cleanup Comments System
This commit is contained in:
@@ -40,12 +40,14 @@ use \Toastr;
|
||||
|
||||
class CommentController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @var TaggedUserRepository
|
||||
*/
|
||||
private $tag;
|
||||
|
||||
/**
|
||||
* @var ChatRepository
|
||||
*/
|
||||
private $chat;
|
||||
|
||||
public function __construct(TaggedUserRepository $tag, ChatRepository $chat)
|
||||
@@ -55,316 +57,313 @@ class CommentController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment on a artical
|
||||
* Add A Comment To A Article
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $slug
|
||||
* @param $id
|
||||
*
|
||||
* @return Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function article(Request $request, $slug, $id)
|
||||
{
|
||||
$article = Article::findOrFail($id);
|
||||
$user = auth()->user();
|
||||
|
||||
$v = validator($request->all(), [
|
||||
if ($user->can_comment == 0) {
|
||||
return redirect()->route('article', ['slug' => $article->slug, 'id' => $article->id])
|
||||
->with(Toastr::error('Your Comment Rights Have Benn Revoked!!!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->content = $request->input('content');
|
||||
$comment->user_id = $user->id;
|
||||
$comment->article_id = $article->id;
|
||||
|
||||
$v = validator($comment->toArray(), [
|
||||
'content' => 'required',
|
||||
'user_id' => 'required',
|
||||
'article_id' => 'required'
|
||||
]);
|
||||
|
||||
if ($v->failed()) {
|
||||
return redirect()->route('article', [
|
||||
'slug' => $article->slug,
|
||||
'id' => $article->id])->with(Toastr::error('A Error Has Occured And Your Comment Was Not Posted!', 'Whoops!', ['options']));
|
||||
}
|
||||
if ($v->fails()) {
|
||||
return redirect()->route('article', ['slug' => $article->slug, 'id' => $article->id])
|
||||
->with(Toastr::error($v->errors()->toJson(), 'Whoops!', ['options']));
|
||||
} else {
|
||||
$comment->save();
|
||||
|
||||
// User's comment rights disbabled?
|
||||
if ($user->can_comment == 0) {
|
||||
return redirect()->route('article', [
|
||||
'slug' => $article->slug,
|
||||
'id' => $article->id
|
||||
])->with(Toastr::error('Your Comment Rights Have Benn Revoked!!!', 'Whoops!', ['options']));
|
||||
}
|
||||
$article_url = hrefArticle($article);
|
||||
$profile_url = hrefProfile($user);
|
||||
|
||||
$content = $request->input('content');
|
||||
$this->chat->systemMessage(
|
||||
"[url={$profile_url}]{$user->username}[/url] has left a comment on article [url={$article_url}]{$article->title}[/url]"
|
||||
);
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->content = $content;
|
||||
$comment->user_id = $user->id;
|
||||
$comment->article_id = $article->id;
|
||||
$comment->save();
|
||||
if ($this->tag->hasTags($request->input('content'))) {
|
||||
|
||||
$article_url = hrefArticle($article);
|
||||
$profile_url = hrefProfile($user);
|
||||
$pm = "[url={$profile_url}]{$user->username}[/url] has tagged you in a comment. You can view it [url={$article_url}]HERE[/url]";
|
||||
|
||||
$this->chat->systemMessage(
|
||||
"[url={$profile_url}]{$user->username}[/url] has left a comment on article [url={$article_url}]{$article->title}[/url]"
|
||||
);
|
||||
if ($this->tag->contains($request->input('content'), '@here') && $user->group->is_modo) {
|
||||
$users = collect([]);
|
||||
|
||||
if ($this->tag->hasTags($content)) {
|
||||
$article->comments()->get()->each(function ($c, $v) use ($users) {
|
||||
$users->push($c->user);
|
||||
});
|
||||
|
||||
$pm = "[url={$profile_url}]{$user->username}[/url] has tagged you in a comment. You can view it [url={$article_url}]HERE[/url]";
|
||||
|
||||
if ($this->tag->contains($content, '@here') && $user->group->is_modo) {
|
||||
$users = collect([]);
|
||||
|
||||
$article->comments()->get()->each(function ($c, $v) use ($users) {
|
||||
$users->push($c->user);
|
||||
});
|
||||
|
||||
$this->tag->messageUsers($users,
|
||||
"You are being notified by staff!",
|
||||
$pm
|
||||
);
|
||||
} else {
|
||||
$this->tag->messageTaggedUsers($content,
|
||||
"You have been tagged by {$user->username}",
|
||||
$pm
|
||||
);
|
||||
$this->tag->messageUsers($users,
|
||||
"You are being notified by staff!",
|
||||
$pm
|
||||
);
|
||||
} else {
|
||||
$this->tag->messageTaggedUsers($request->input('content'),
|
||||
"You have been tagged by {$user->username}",
|
||||
$pm
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->route('article', [
|
||||
'slug' => $article->slug,
|
||||
'id' => $article->id])->with(Toastr::success('Your Comment Has Been Added!', 'Yay!', ['options']));
|
||||
return redirect()->route('article', ['slug' => $article->slug, 'id' => $article->id])
|
||||
->with(Toastr::success('Your Comment Has Been Added!', 'Yay!', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment on a torrent
|
||||
* Add A Comment To A Torrent
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function torrent(Request $request, $slug, $id)
|
||||
{
|
||||
$torrent = Torrent::findOrFail($id);
|
||||
$user = auth()->user();
|
||||
|
||||
$v = validator($request->all(), [
|
||||
if ($user->can_comment == 0) {
|
||||
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])
|
||||
->with(Toastr::error('Your Comment Rights Have Benn Revoked!!!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->content = $request->input('content');;
|
||||
$comment->anon = $request->input('anonymous');
|
||||
$comment->user_id = $user->id;
|
||||
$comment->torrent_id = $torrent->id;
|
||||
|
||||
$v = validator($comment->toArray(), [
|
||||
'content' => 'required',
|
||||
'user_id' => 'required',
|
||||
'torrent_id' => 'required',
|
||||
'anon' => 'required'
|
||||
]);
|
||||
|
||||
if ($v->failed()) {
|
||||
return redirect()->route('torrent', [
|
||||
'slug' => $torrent->slug,
|
||||
'id' => $torrent->id
|
||||
])->with(Toastr::error('A Error Has Occured And Your Comment Was Not Posted!', 'Sorry', ['options']));
|
||||
}
|
||||
|
||||
// User's comment rights disbabled?
|
||||
if ($user->can_comment == 0) {
|
||||
return redirect()->route('torrent', [
|
||||
'slug' => $torrent->slug,
|
||||
'id' => $torrent->id
|
||||
])->with(Toastr::error('Your Comment Rights Have Benn Revoked!!!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
$content = $request->input('content');
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->content = $content;
|
||||
$comment->anon = $request->input('anonymous');
|
||||
$comment->user_id = $user->id;
|
||||
$comment->torrent_id = $torrent->id;
|
||||
$comment->save();
|
||||
|
||||
//Notification
|
||||
if ($user->id != $torrent->user_id) {
|
||||
User::find($torrent->user_id)->notify(new NewTorrentComment($comment));
|
||||
}
|
||||
|
||||
$torrent_url = hrefTorrent($torrent);
|
||||
$profile_url = hrefProfile($user);
|
||||
|
||||
// Auto Shout
|
||||
if ($comment->anon == 0) {
|
||||
$this->chat->systemMessage(
|
||||
"[url={$profile_url}]{$user->username}[/url] has left a comment on Torrent [url={$torrent_url}]{$torrent->name}[/url]"
|
||||
);
|
||||
if ($v->fails()) {
|
||||
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])
|
||||
->with(Toastr::error($v->errors()->toJson(), 'Whoops!', ['options']));
|
||||
} else {
|
||||
$this->chat->systemMessage(
|
||||
"An anonymous user has left a comment on torrent [url={$torrent_url}]{$torrent->name}[/url]"
|
||||
);
|
||||
}
|
||||
$comment->save();
|
||||
|
||||
if ($this->tag->hasTags($content)) {
|
||||
//Notification
|
||||
if ($user->id != $torrent->user_id) {
|
||||
User::find($torrent->user_id)->notify(new NewTorrentComment($comment));
|
||||
}
|
||||
|
||||
$message = "[url={$profile_url}]{$user->username}[/url] has tagged you in a comment. You can view it [url={$torrent_url}]HERE[/url]";
|
||||
$torrent_url = hrefTorrent($torrent);
|
||||
$profile_url = hrefProfile($user);
|
||||
|
||||
if ($this->tag->contains($content, '@here') && $user->group->is_modo) {
|
||||
$users = collect([]);
|
||||
|
||||
$torrent->comments()->get()->each(function ($c, $v) use ($users) {
|
||||
$users->push($c->user);
|
||||
});
|
||||
|
||||
$this->tag->messageUsers($users,
|
||||
"You are being notified by staff!",
|
||||
$message
|
||||
// Auto Shout
|
||||
if ($comment->anon == 0) {
|
||||
$this->chat->systemMessage(
|
||||
"[url={$profile_url}]{$user->username}[/url] has left a comment on Torrent [url={$torrent_url}]{$torrent->name}[/url]"
|
||||
);
|
||||
} else {
|
||||
$this->tag->messageTaggedUsers($content,
|
||||
"You have been tagged by {$user->username}",
|
||||
$message
|
||||
$this->chat->systemMessage(
|
||||
"An anonymous user has left a comment on torrent [url={$torrent_url}]{$torrent->name}[/url]"
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->tag->hasTags($request->input('content'))) {
|
||||
|
||||
$message = "[url={$profile_url}]{$user->username}[/url] has tagged you in a comment. You can view it [url={$torrent_url}]HERE[/url]";
|
||||
|
||||
if ($this->tag->contains($request->input('content'), '@here') && $user->group->is_modo) {
|
||||
$users = collect([]);
|
||||
|
||||
$torrent->comments()->get()->each(function ($c, $v) use ($users) {
|
||||
$users->push($c->user);
|
||||
});
|
||||
|
||||
$this->tag->messageUsers($users,
|
||||
"You are being notified by staff!",
|
||||
$message
|
||||
);
|
||||
} else {
|
||||
$this->tag->messageTaggedUsers($request->input('content'),
|
||||
"You have been tagged by {$user->username}",
|
||||
$message
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Achievements
|
||||
$user->unlock(new UserMadeComment(), 1);
|
||||
$user->addProgress(new UserMadeTenComments(), 1);
|
||||
$user->addProgress(new UserMade50Comments(), 1);
|
||||
$user->addProgress(new UserMade100Comments(), 1);
|
||||
$user->addProgress(new UserMade200Comments(), 1);
|
||||
$user->addProgress(new UserMade300Comments(), 1);
|
||||
$user->addProgress(new UserMade400Comments(), 1);
|
||||
$user->addProgress(new UserMade500Comments(), 1);
|
||||
$user->addProgress(new UserMade600Comments(), 1);
|
||||
$user->addProgress(new UserMade700Comments(), 1);
|
||||
$user->addProgress(new UserMade800Comments(), 1);
|
||||
$user->addProgress(new UserMade900Comments(), 1);
|
||||
|
||||
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])
|
||||
->with(Toastr::success('Your Comment Has Been Added!', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
// Achievements
|
||||
$user->unlock(new UserMadeComment(), 1);
|
||||
$user->addProgress(new UserMadeTenComments(), 1);
|
||||
$user->addProgress(new UserMade50Comments(), 1);
|
||||
$user->addProgress(new UserMade100Comments(), 1);
|
||||
$user->addProgress(new UserMade200Comments(), 1);
|
||||
$user->addProgress(new UserMade300Comments(), 1);
|
||||
$user->addProgress(new UserMade400Comments(), 1);
|
||||
$user->addProgress(new UserMade500Comments(), 1);
|
||||
$user->addProgress(new UserMade600Comments(), 1);
|
||||
$user->addProgress(new UserMade700Comments(), 1);
|
||||
$user->addProgress(new UserMade800Comments(), 1);
|
||||
$user->addProgress(new UserMade900Comments(), 1);
|
||||
|
||||
return redirect()->route('torrent', [
|
||||
'slug' => $torrent->slug,
|
||||
'id' => $torrent->id
|
||||
])->with(Toastr::success('Your Comment Has Been Added!', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment on a request
|
||||
* Add A Comment To A Request
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function request(Request $request, $id)
|
||||
{
|
||||
$tr = TorrentRequest::findOrFail($id);
|
||||
$user = auth()->user();
|
||||
|
||||
if ($user->can_comment == 0) {
|
||||
return redirect()->route('request', ['id' => $tr->id])
|
||||
->with(Toastr::error('Your Comment Rights Have Benn Revoked!!!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->content = $request->input('content');
|
||||
$comment->anon = $request->input('anonymous');
|
||||
$comment->user_id = $user->id;
|
||||
$comment->requests_id = $tr->id;
|
||||
|
||||
$v = validator($request->all(), [
|
||||
'content' => 'required',
|
||||
'user_id' => 'required',
|
||||
'requests_id' => 'required'
|
||||
]);
|
||||
|
||||
if ($v->failed()) {
|
||||
return redirect()->route('request', [
|
||||
'id' => $request->id
|
||||
])->with(Toastr::error('A Error Has Occured And Your Comment Was Not Posted!', 'Sorry', ['options']));
|
||||
}
|
||||
|
||||
// User's comment rights disbabled?
|
||||
if ($user->can_comment == 0) {
|
||||
return redirect()->route('request', [
|
||||
'id' => $request->id
|
||||
])->with(Toastr::error('Your Comment Rights Have Benn Revoked!!!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
$content = $request->input('content');
|
||||
|
||||
$comment = new Comment();
|
||||
$comment->content = $content;
|
||||
$comment->anon = $request->input('anonymous');
|
||||
$comment->user_id = $user->id;
|
||||
$comment->requests_id = $tr->id;
|
||||
$comment->save();
|
||||
|
||||
$tr_url = hrefTorrentRequest($tr);
|
||||
$profile_url = hrefProfile($user);
|
||||
|
||||
// Auto Shout
|
||||
if ($comment->anon == 0) {
|
||||
$this->chat->systemMessage(
|
||||
"[url={$profile_url}]{$user->username}[/url] has left a comment on Request [url={$tr_url}]{$tr->name}[/url]"
|
||||
);
|
||||
if ($v->fails()) {
|
||||
return redirect()->route('request', ['id' => $tr->id])
|
||||
->with(Toastr::error($v->errors()->toJson(), 'Whoops!', ['options']));
|
||||
} else {
|
||||
$this->chat->systemMessage(
|
||||
"An anonymous user has left a comment on Request [url={$tr_url}]{$tr->name}[/url]"
|
||||
);
|
||||
}
|
||||
$comment->save();
|
||||
|
||||
if ($this->tag->hasTags($content)) {
|
||||
$tr_url = hrefTorrentRequest($tr);
|
||||
$profile_url = hrefProfile($user);
|
||||
|
||||
$message = "[url={$profile_url}]{$user->username}[/url] has tagged you in a comment. You can view it [url={$tr_url}] HERE [/url]";
|
||||
|
||||
if ($this->tag->contains($content, '@here') && $user->group->is_modo) {
|
||||
$users = collect([]);
|
||||
|
||||
$tr->comments()->get()->each(function ($c, $v) use ($users) {
|
||||
$users->push($c->user);
|
||||
});
|
||||
|
||||
$this->tag->messageUsers($users,
|
||||
"You are being notified by staff!",
|
||||
$message
|
||||
// Auto Shout
|
||||
if ($comment->anon == 0) {
|
||||
$this->chat->systemMessage(
|
||||
"[url={$profile_url}]{$user->username}[/url] has left a comment on Request [url={$tr_url}]{$tr->name}[/url]"
|
||||
);
|
||||
} else {
|
||||
$this->tag->messageTaggedUsers($content,
|
||||
"You have been tagged by {$user->username}",
|
||||
$message
|
||||
$this->chat->systemMessage(
|
||||
"An anonymous user has left a comment on Request [url={$tr_url}]{$tr->name}[/url]"
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->tag->hasTags($request->input('content'))) {
|
||||
|
||||
$message = "[url={$profile_url}]{$user->username}[/url] has tagged you in a comment. You can view it [url={$tr_url}] HERE [/url]";
|
||||
|
||||
if ($this->tag->contains($request->input('content'), '@here') && $user->group->is_modo) {
|
||||
$users = collect([]);
|
||||
|
||||
$tr->comments()->get()->each(function ($c, $v) use ($users) {
|
||||
$users->push($c->user);
|
||||
});
|
||||
|
||||
$this->tag->messageUsers($users,
|
||||
"You are being notified by staff!",
|
||||
$message
|
||||
);
|
||||
} else {
|
||||
$this->tag->messageTaggedUsers($request->input('content'),
|
||||
"You have been tagged by {$user->username}",
|
||||
$message
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Achievements
|
||||
$user->unlock(new UserMadeComment(), 1);
|
||||
$user->addProgress(new UserMadeTenComments(), 1);
|
||||
$user->addProgress(new UserMade50Comments(), 1);
|
||||
$user->addProgress(new UserMade100Comments(), 1);
|
||||
$user->addProgress(new UserMade200Comments(), 1);
|
||||
$user->addProgress(new UserMade300Comments(), 1);
|
||||
$user->addProgress(new UserMade400Comments(), 1);
|
||||
$user->addProgress(new UserMade500Comments(), 1);
|
||||
$user->addProgress(new UserMade600Comments(), 1);
|
||||
$user->addProgress(new UserMade700Comments(), 1);
|
||||
$user->addProgress(new UserMade800Comments(), 1);
|
||||
$user->addProgress(new UserMade900Comments(), 1);
|
||||
|
||||
// Auto PM
|
||||
if ($user->id != $request->user_id) {
|
||||
$pm = new PrivateMessage;
|
||||
$pm->sender_id = 1;
|
||||
$pm->receiver_id = $tr->user_id;
|
||||
$pm->subject = "Your Request " . $tr->name . " Has A New Comment!";
|
||||
$pm->message = $comment->user->username . " Has Left A Comment On [url={$tr_url}]" . $tr->name . "[/url]";
|
||||
$pm->save();
|
||||
}
|
||||
|
||||
return redirect()->route('request', ['id' => $tr->id])
|
||||
->with(Toastr::success('Your Comment Has Been Added!', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
// Achievements
|
||||
$user->unlock(new UserMadeComment(), 1);
|
||||
$user->addProgress(new UserMadeTenComments(), 1);
|
||||
$user->addProgress(new UserMade50Comments(), 1);
|
||||
$user->addProgress(new UserMade100Comments(), 1);
|
||||
$user->addProgress(new UserMade200Comments(), 1);
|
||||
$user->addProgress(new UserMade300Comments(), 1);
|
||||
$user->addProgress(new UserMade400Comments(), 1);
|
||||
$user->addProgress(new UserMade500Comments(), 1);
|
||||
$user->addProgress(new UserMade600Comments(), 1);
|
||||
$user->addProgress(new UserMade700Comments(), 1);
|
||||
$user->addProgress(new UserMade800Comments(), 1);
|
||||
$user->addProgress(new UserMade900Comments(), 1);
|
||||
|
||||
// Auto PM
|
||||
if ($user->id != $request->user_id) {
|
||||
$pm = new PrivateMessage;
|
||||
$pm->sender_id = 1;
|
||||
$pm->receiver_id = $tr->user_id;
|
||||
$pm->subject = "Your Request " . $tr->name . " Has A New Comment!";
|
||||
$pm->message = $comment->user->username . " Has Left A Comment On [url={$tr_url}]" . $tr->name . "[/url]";
|
||||
$pm->save();
|
||||
}
|
||||
|
||||
return redirect()->route('request', [
|
||||
'id' => $tr->id
|
||||
])->with(Toastr::success('Your Comment Has Been Added!', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment on a torrent via quickthanks
|
||||
* Add A Comment To A Torrent Via Quick Thanks
|
||||
*
|
||||
* @param $slug
|
||||
* @param $id
|
||||
* @return Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function quickthanks($id)
|
||||
{
|
||||
$torrent = Torrent::findOrFail($id);
|
||||
$user = auth()->user();
|
||||
$uploader = $torrent->user;
|
||||
|
||||
// User's comment rights disbabled?
|
||||
if ($user->can_comment == 0) {
|
||||
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])->with(Toastr::error('Your Comment Rights Have Benn Revoked!!!', 'Whoops!', ['options']));
|
||||
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])
|
||||
->with(Toastr::error('Your Comment Rights Have Benn Revoked!!!', 'Whoops!', ['options']));
|
||||
}
|
||||
|
||||
$comment = new Comment();
|
||||
$thankArray = ["Thanks for the upload! :thumbsup_tone2:", "Time and effort is much appreciated :thumbsup_tone2:", "Great upload! :fire:", "Thankyou :smiley:"];
|
||||
$thankArray = [
|
||||
"Thanks for the upload! :thumbsup_tone2:",
|
||||
"Time and effort is much appreciated :thumbsup_tone2:",
|
||||
"Great upload! :fire:", "Thankyou :smiley:"
|
||||
];
|
||||
$selected = mt_rand(0, count($thankArray) - 1);
|
||||
$comment->content = $thankArray[$selected];
|
||||
$comment->user_id = $user->id;
|
||||
$comment->torrent_id = $torrent->id;
|
||||
$v = validator($comment->toArray(), ['content' => 'required', 'user_id' => 'required', 'torrent_id' => 'required']);
|
||||
if ($v->passes()) {
|
||||
|
||||
$v = validator($comment->toArray(), [
|
||||
'content' => 'required',
|
||||
'user_id' => 'required',
|
||||
'torrent_id' => 'required'
|
||||
]);
|
||||
|
||||
if ($v->fails()) {
|
||||
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])
|
||||
->with(Toastr::error($v->errors()->toJson(), 'Whoops!', ['options']));
|
||||
} else {
|
||||
$comment->save();
|
||||
Toastr::success('Your Comment Has Been Added!', 'Yay!', ['options']);
|
||||
|
||||
// Achievements
|
||||
$user->unlock(new UserMadeComment(), 1);
|
||||
@@ -393,18 +392,17 @@ class CommentController extends Controller
|
||||
"[url={$profile_url}]{$user->username}[/url] has left a comment on Torrent [url={$torrent_url}]{$torrent->name}[/url]"
|
||||
);
|
||||
|
||||
} else {
|
||||
Toastr::error('A Error Has Occured And Your Comment Was Not Posted!', 'Whoops!', ['options']);
|
||||
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id])
|
||||
->with(Toastr::success('Your Comment Has Been Added!', 'Yay!', ['options']));
|
||||
}
|
||||
|
||||
return redirect()->route('torrent', ['slug' => $torrent->slug, 'id' => $torrent->id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a comment
|
||||
*
|
||||
* Edit A Comment
|
||||
*
|
||||
* @param Request $request
|
||||
* @param $comment_id
|
||||
* @return Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function editComment(Request $request, $comment_id)
|
||||
{
|
||||
@@ -423,10 +421,10 @@ class CommentController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a comment on a torrent
|
||||
*
|
||||
* Delete A Comment
|
||||
*
|
||||
* @param $comment_id
|
||||
* @return Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function deleteComment($comment_id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user