瀏覽代碼

Add bbcode [from]

For moderation.
Visman 3 年之前
父節點
當前提交
096dda59b7
共有 4 個文件被更改,包括 22 次插入0 次删除
  1. 11 0
      app/config/defaultBBCode.php
  2. 3 0
      app/lang/en/common.po
  3. 3 0
      app/lang/ru/common.po
  4. 5 0
      public/style/ForkBB/style.css

+ 11 - 0
app/config/defaultBBCode.php

@@ -544,4 +544,15 @@ foreach ($attrs as $key => $val) {
 return "<td{$attr}><p>{$body}</p></td>";
 HANDLER,
     ],
+    [
+        'tag' => 'from',
+        'type' => 'block',
+        'text_only' => true,
+        'handler' => <<<'HANDLER'
+$body = __(['Post from topic %s', \htmlspecialchars_decode($body, \ENT_QUOTES | \ENT_HTML5)]);
+
+return "</p><p class=\"f-bb-from\">{$body}</p><p>";
+HANDLER,
+    ],
+
 ];

+ 3 - 0
app/lang/en/common.po

@@ -454,3 +454,6 @@ msgstr "Unsubscribe"
 
 msgid "Subscribe"
 msgstr "Subscribe"
+
+msgid "Post from topic %s"
+msgstr "This post is moved from the topic &quot;%s&quot;"

+ 3 - 0
app/lang/ru/common.po

@@ -456,3 +456,6 @@ msgstr "Отписаться"
 
 msgid "Subscribe"
 msgstr "Подписаться"
+
+msgid "Post from topic %s"
+msgstr "Это сообщение перенесено из темы &quot;%s&quot;"

+ 5 - 0
public/style/ForkBB/style.css

@@ -1599,6 +1599,11 @@ body,
   border-inline-start: 0.1875rem solid #AA7939;
 }
 
+#fork .f-bb-from {
+  font-size: 0.8rem;
+  font-style: italic;
+}
+
 #fork .f-post-body p,
 #fork .f-post-body blockquote,
 #fork .f-post-body br,