From be08d2bba96a03342c92c6e331952c5d9058b9e8 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 28 Jan 2024 13:40:36 +0700 Subject: [PATCH] Some enhancements for topic_tpl (#1356) * Some enhancements for topic_tpl * Update CHANGELOG.md * Update posting_tpl.tpl --- CHANGELOG.md | 1 + library/ajax/topic_tpl.php | 7 +++++-- styles/templates/posting_tpl.tpl | 20 +++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65cbc3584..c922189fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Fixed auth(): empty $f_access [\#1329](https://github.com/torrentpier/torrentpier/pull/1329) ([belomaxorka](https://github.com/belomaxorka)) - Fixed download counter for torrents [\#1346](https://github.com/torrentpier/torrentpier/pull/1346) ([belomaxorka](https://github.com/belomaxorka)) - Fixed HTTP 500 while cron running in server-side [\#1321](https://github.com/torrentpier/torrentpier/pull/1321) ([belomaxorka](https://github.com/belomaxorka)) +- Some enhancements for topic_tpl [\#1356](https://github.com/torrentpier/torrentpier/pull/1356) ([belomaxorka](https://github.com/belomaxorka)) - Sending debug errors to us 🌚 via Telegram bot [\#1323](https://github.com/torrentpier/torrentpier/pull/1323) ([belomaxorka](https://github.com/belomaxorka)) - Don't update downloads counter if attachment not exists [\#1345](https://github.com/torrentpier/torrentpier/pull/1345) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#1306](https://github.com/torrentpier/torrentpier/pull/1306), [\#1307](https://github.com/torrentpier/torrentpier/pull/1307), [\#1308](https://github.com/torrentpier/torrentpier/pull/1308), [\#1315](https://github.com/torrentpier/torrentpier/pull/1315), [\#1328](https://github.com/torrentpier/torrentpier/pull/1328), [\#1338](https://github.com/torrentpier/torrentpier/pull/1338), [\#1353](https://github.com/torrentpier/torrentpier/pull/1353), [\#1355](https://github.com/torrentpier/torrentpier/pull/1355) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/ajax/topic_tpl.php b/library/ajax/topic_tpl.php index b603d8450..a2f75d22f 100644 --- a/library/ajax/topic_tpl.php +++ b/library/ajax/topic_tpl.php @@ -134,7 +134,7 @@ switch ($mode) { $this->response['tpl_id'] = $tpl_id; $this->response['tpl_name'] = $tpl_name; $this->response['html']['tpl-last-edit-time'] = bb_date(TIMENOW, 'd-M-y H:i'); - $this->response['html']['tpl-last-edit-by'] = $userdata['username']; + $this->response['html']['tpl-last-edit-by'] = profile_url(get_userdata($userdata['username'], true)); break; // создание нового шаблона @@ -157,7 +157,10 @@ switch ($mode) { if (!DB()->query($sql)) { $sql_error = DB()->sql_error(); } - DB()->query("UPDATE " . BB_FORUMS . " SET forum_tpl_id = 0 WHERE forum_id = $forum_id LIMIT 1"); + $get_forum_tpl_id = DB()->fetch_row("SELECT forum_tpl_id FROM " . BB_FORUMS . " WHERE forum_id = " . $forum_id . " LIMIT 1"); + if ($tpl_id == $get_forum_tpl_id['forum_tpl_id']) { + DB()->query("UPDATE " . BB_FORUMS . " SET forum_tpl_id = 0 WHERE forum_id = $forum_id LIMIT 1"); + } $this->response['msg'] = "Шаблон {$tpl_data['tpl_name']} успешно удалён"; break; diff --git a/styles/templates/posting_tpl.tpl b/styles/templates/posting_tpl.tpl index 9ef5e3424..826155c50 100644 --- a/styles/templates/posting_tpl.tpl +++ b/styles/templates/posting_tpl.tpl @@ -4796,9 +4796,10 @@ $(function(){
-
- -
+
+    + +
@@ -4817,9 +4818,10 @@ $(function(){ После заполнения поля форма нажмите кнопку Создать форму

В поле сообщение добавьте элементам необходимые атрибуты (req, spoiler и т.д.)

Заполните созданную форму (вручную либо автозаполнителем)

- Кнопки Продолжить и Создать сообщение создают ббкод сообщения

- Кнопка Создать HTML - создает HTML сообщения

- Заполните поле название + Кнопки Продолжить и Создать сообщение создают BBCode сообщения

+ Кнопка Предпросмотр - показывает итоговый результат

+ Заполните поле название

+ Далее нажмите на кнопку Продолжить (Создать релиз) - откроется страница где вы сможете прикрепить файл и опубликовать релиз @@ -4843,19 +4845,19 @@ $(function(){ - Заполните форму для релиза   [ Заполнить ] + Заполните форму для релиза   [ Заполнить ] - На следующей странице проверьте оформление и загрузите torrent файл + На следующей странице проверьте оформление и загрузите файл -    +