소스 검색

2018-01-08 tpl

Visman 7 년 전
부모
커밋
69d9817588
3개의 변경된 파일2개의 추가작업 그리고 35개의 파일을 삭제
  1. 0 33
      app/Models/CensorshipList/Load.php
  2. 1 1
      app/templates/layouts/form.tpl
  3. 1 1
      app/templates/topic.tpl

+ 0 - 33
app/Models/CensorshipList/Load.php

@@ -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;
-    }
-}

+ 1 - 1
app/templates/layouts/form.tpl

@@ -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

+ 1 - 1
app/templates/topic.tpl

@@ -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>