From a1cd85b48b2e61fe21ad48c93365696454401266 Mon Sep 17 00:00:00 2001
From: Choom
Date: Sat, 17 Dec 2022 16:37:39 -0300
Subject: Quitando eliminados de IB
---
cgi/manage.py | 19 ++++++++-----------
cgi/templates/board.0.html | 10 +++-------
cgi/templates/board.html | 16 +++++++---------
cgi/templates/board.jp.html | 12 ++++--------
4 files changed, 22 insertions(+), 35 deletions(-)
(limited to 'cgi')
diff --git a/cgi/manage.py b/cgi/manage.py
index b98ae06..ca1ace6 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -995,32 +995,29 @@ def manage(self, path_split):
if path_split[4] == 'restore':
board = setBoard(path_split[5])
- post = FetchOne('SELECT `parentid` FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1',
- (board['id'], path_split[6]))
+ post = FetchOne('SELECT `parentid`, `IS_DELETED` FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1', (board['id'], path_split[6]))
if not post:
- message = _(
- 'Unable to locate a post with that ID.') + '
'
+ message = _('Unable to locate a post with that ID.') + '
'
template_filename = "message.html"
else:
- UpdateDb('UPDATE `posts` SET `IS_DELETED` = 0 WHERE `boardid` = %s AND `id` = %s LIMIT 1',
- (board['id'], path_split[6]))
+ UpdateDb('UPDATE `posts` SET `IS_DELETED` = 0 WHERE `boardid` = %s AND `id` = %s LIMIT 1', (board['id'], path_split[6]))
if post['parentid'] != 0:
threadUpdated(post['parentid'])
else:
regenerateFrontPages()
- regenerateTrash()
+ if post['IS_DELETED'] == 2:
+ regenerateTrash()
+
message = _('Post successfully restored.')
- logAction(staff_account['username'], _('Restored post %s') % (
- '/' + path_split[5] + '/' + path_split[6]))
+ logAction(staff_account['username'], _('Restored post %s') % ('/' + path_split[5] + '/' + path_split[6]) )
if path_split[4] == 'delete':
board = setBoard(path_split[5])
post = FetchOne('SELECT id, parentid, message, INET6_NTOA(ip) AS ip FROM `posts` WHERE `boardid` = %s AND `id` = %s LIMIT 1',
(board['id'], path_split[6]))
if not post:
- message = _(
- 'Unable to locate a post with that ID.')
+ message = _('Unable to locate a post with that ID.')
else:
deletePost(post['id'], None)
diff --git a/cgi/templates/board.0.html b/cgi/templates/board.0.html
index 525a041..7097f2a 100644
--- a/cgi/templates/board.0.html
+++ b/cgi/templates/board.0.html
@@ -120,7 +120,7 @@