refactor: encapsed strings to sprintf

This commit is contained in:
HDVinnie
2020-02-17 13:52:20 -05:00
parent 61fa3f8900
commit 605c337204
61 changed files with 245 additions and 218 deletions
+12 -12
View File
@@ -101,11 +101,11 @@ class CommentController extends Controller
// Auto Shout
if ($comment->anon == 0) {
$this->chat->systemMessage(
"[url={$profile_url}]{$user->username}[/url] has left a comment on article [url={$article_url}]{$article->title}[/url]"
sprintf('[url=%s]%s[/url] has left a comment on article [url=%s]%s[/url]', $profile_url, $user->username, $article_url, $article->title)
);
} else {
$this->chat->systemMessage(
"An anonymous user has left a comment on article [url={$article_url}]{$article->title}[/url]"
sprintf('An anonymous user has left a comment on article [url=%s]%s[/url]', $article_url, $article->title)
);
}
if ($this->tag->hasTags($request->input('content'))) {
@@ -192,11 +192,11 @@ class CommentController extends Controller
// Auto Shout
if ($comment->anon == 0) {
$this->chat->systemMessage(
"[url={$profile_url}]{$user->username}[/url] has left a comment on playlist [url={$playlist_url}]{$playlist->name}[/url]"
sprintf('[url=%s]%s[/url] has left a comment on playlist [url=%s]%s[/url]', $profile_url, $user->username, $playlist_url, $playlist->name)
);
} else {
$this->chat->systemMessage(
"An anonymous user has left a comment on playlist [url={$playlist_url}]{$playlist->name}[/url]"
sprintf('An anonymous user has left a comment on playlist [url=%s]%s[/url]', $playlist_url, $playlist->name)
);
}
if ($this->tag->hasTags($request->input('content'))) {
@@ -287,11 +287,11 @@ class CommentController extends Controller
// 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]"
sprintf('[url=%s]%s[/url] has left a comment on Torrent [url=%s]%s[/url]', $profile_url, $user->username, $torrent_url, $torrent->name)
);
} else {
$this->chat->systemMessage(
"An anonymous user has left a comment on torrent [url={$torrent_url}]{$torrent->name}[/url]"
sprintf('An anonymous user has left a comment on torrent [url=%s]%s[/url]', $torrent_url, $torrent->name)
);
}
if ($this->tag->hasTags($request->input('content'))) {
@@ -378,11 +378,11 @@ class CommentController extends Controller
// 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]"
sprintf('[url=%s]%s[/url] has left a comment on Request [url=%s]%s[/url]', $profile_url, $user->username, $tr_url, $tr->name)
);
} else {
$this->chat->systemMessage(
"An anonymous user has left a comment on Request [url={$tr_url}]{$tr->name}[/url]"
sprintf('An anonymous user has left a comment on Request [url=%s]%s[/url]', $tr_url, $tr->name)
);
}
//Notification
@@ -463,9 +463,9 @@ class CommentController extends Controller
$uploader_url = hrefProfile($uploader);
$thankArray = [
"Thanks for the upload [url={$uploader_url}][color={$uploader->group->color}][b]{$uploader->username}[/b][/color][/url] :vulcan_tone2:",
"Beautiful upload [url={$uploader_url}][color={$uploader->group->color}][b]{$uploader->username}[/b][/color][/url] :fire:",
"Cheers [url={$uploader_url}][color={$uploader->group->color}][b]{$uploader->username}[/b][/color][/url] for the upload :beers:",
sprintf('Thanks for the upload [url=%s][color=%s][b]%s[/b][/color][/url] :vulcan_tone2:', $uploader_url, $uploader->group->color, $uploader->username),
sprintf('Beautiful upload [url=%s][color=%s][b]%s[/b][/color][/url] :fire:', $uploader_url, $uploader->group->color, $uploader->username),
sprintf('Cheers [url=%s][color=%s][b]%s[/b][/color][/url] for the upload :beers:', $uploader_url, $uploader->group->color, $uploader->username),
];
}
@@ -506,7 +506,7 @@ class CommentController extends Controller
$torrent_url = hrefTorrent($torrent);
$profile_url = hrefProfile($user);
$this->chat->systemMessage(
"[url={$profile_url}]{$user->username}[/url] has left a comment on Torrent [url={$torrent_url}]{$torrent->name}[/url]"
sprintf('[url=%s]%s[/url] has left a comment on Torrent [url=%s]%s[/url]', $profile_url, $user->username, $torrent_url, $torrent->name)
);
return redirect()->route('torrent', ['id' => $torrent->id])