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(){