2018-01-08 tpl

This commit is contained in:
Visman 2018-01-08 16:17:44 +07:00
parent e446f4243d
commit 69d9817588
3 changed files with 2 additions and 35 deletions

View file

@ -1,33 +0,0 @@
<?php
namespace ForkBB\Models\CensorshipList;
use ForkBB\Models\Method;
class Load extends Method
{
/**
* Заполняет модель данными из БД
* Создает кеш
*
* @return CensorshipList
*/
public function load()
{
$stmt = $this->c->DB->query('SELECT search_for, replace_with FROM ::censoring');
$search = [];
$replace = [];
while ($row = $stmt->fetch()) {
$replace[] = $row['replace_with'];
$search[] = '%(?<![\p{L}\p{N}])('.str_replace('\*', '[\p{L}\p{N}]*?', preg_quote($row['search_for'], '%')).')(?![\p{L}\p{N}])%iu';
}
$this->model->searchList = $search;
$this->model->replaceList = $replace;
$this->c->Cache->set('censorship', [
'searchList' => $search,
'replaceList' => $replace,
]);
return $this->model;
}
}

View file

@ -14,7 +14,7 @@
@endif
@endforeach
@elseif (isset($set['fields']))
<fieldset>
<fieldset @if (isset($set['id'])) id="{{ $set['id'] }}" @endif>
@if (isset($set['legend']))
<legend>{!! $set['legend'] !!}</legend>
@endif

View file

@ -75,7 +75,7 @@
</li>
@endif
<li class="f-usertitle"><span>{{ $post->user->title() }}</span></li>
@if ($post->showUserInfo && $post->user->num_posts)
@if ($post->showPostCount && $post->user->num_posts)
<li class="f-postcount"><span>{!! __('%s post', $post->user->num_posts, num($post->user->num_posts)) !!}</span></li>
@endif
</ul>