@if ($post->files->isNotEmpty())
<div class="section-media">
<i class="fa fa-paperclip"></i> <b>{{ __('main.attached_files') }}:</b><br>
@foreach ($post->files as $file)
<div class="media-file">
{{ icons($file->extension) }}
<a href="{{ $file->hash }}">{{ $file->name }}</a> ({{ formatSize($file->size) }})<br>
@if ($file->isImage())
<a href="{{ $file->hash }}" class="gallery" data-group="{{ $post->id }}">{{ resizeImage($file->hash, ['alt' => $file->name]) }}</a>
@endif
</div>
@endforeach
</div>
@endif
@if ($post->files->isNotEmpty())
<button class="btn btn-dark" type="button" data-bs-toggle="collapse" data-bs-target="#attach{{$post->id}}" aria-expanded="false" aria-controls="attach{{$post->id}}">
{{ __('main.attached_files') }}
</button>
</p>
<div class="collapse" id="attach{{$post->id}}">
<div class="card card-body">
@foreach ($post->files as $file)
<div class="media-file">
{{ icons($file->extension) }}
<a href="{{ $file->hash }}">{{ $file->name }}</a> ({{ formatSize($file->size) }})<br>
@if ($file->isImage())
<a href="{{ $file->hash }}" class="gallery" data-group="{{ $post->id }}">{{ resizeImage($file->hash, ['alt' => $file->name]) }}</a>
@endif
@if ($file->extension == 'mp3' OR $file->extension == 'aac')
<audio preload="none" controls style="max-width:100%;">
<source src="{{ $file->hash }}" type="audio/mp3">
</audio>
@endif
</div>
@endforeach
</div></div>
@endif
@if ($topics->isNotEmpty())
<div class="section-body">
@foreach ($topics as $topic)
<i class="fas {{ $topic->getIcon() }} text-muted"></i> <a href="/topics/{{ $topic->id }}">{{ $topic->title }}</a>
{{ $topic->lastPost->user->getProfile() }}
<a class="badge badge-light" href="/topics/end/{{ $topic->id }}">{{ $topic->count_posts }}</a><br>
@endforeach
</div>
@endif
'hideInt' => [
'pattern' => '/[hide=([#0-9]+)](.+?)[/hide]/s',
'callback' => 'hiddenInt',
],
public function hiddenInt(array $match): string
{
return '<div class="hidden-text">
<span class="font-weight-bold">' . __('main.hidden_content') . ' + '.$match[1].' баллов:</span> ' .
(getUser() && getUser()->point >= $match[1] ? $match[2] : __('main.not_authorized')) .
'</div>';
}