From dd0483ce21f95385c41495c88d3c84225e14b412 Mon Sep 17 00:00:00 2001 From: Choom Date: Thu, 26 Jan 2023 23:33:18 -0300 Subject: Tabla para basural --- cgi/manage.py | 24 ++++++++++++++++++++++-- cgi/templates/manage/basural.html | 30 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 cgi/templates/manage/basural.html (limited to 'cgi') diff --git a/cgi/manage.py b/cgi/manage.py index bf28768..d3595bd 100644 --- a/cgi/manage.py +++ b/cgi/manage.py @@ -2172,11 +2172,31 @@ def manage(self, path_split): # reflect changes threadUpdated(parent) + elif path_split[2] == 'basural': + if not administrator: + return + + #basural = FetchAll('SELECT basural.id AS id, origid, timestamp_formatted AS fecha, basural.subject AS subject, basural.message AS message, boards.name AS board FROM basural INNER JOIN boards ON boardid = boards.id ORDER BY timestamp DESC') + #basural = FetchAll('SELECT * FROM basural') + #template_filename = "basural.html" + #template_values = {'basural': basural} + + #posts = FetchAll('select * from posts where IS_DELETED = 2') + # + #count = 0 + #for post in posts: + # msg = formatting.remove_html(post['message']) + # ts = formatTimestamp(post['timestamp']) + # ins = InsertDb('INSERT INTO `basural` (`origid`, `boardid`, `timestamp`, `timestamp_formatted`, `subject`, `message`) VALUES (%s, %s, %s, %s, %s, %s)', (post['id'], post['boardid'], post['timestamp'], ts, post['subject'], msg) ) + # self.output += msg + '
' + # count += 1 + + #self.output += '
'+str(count) + elif path_split[2] == 'search': if not administrator: return - search_logs = FetchAll( - 'SELECT `id`,`timestamp`,`keyword`,`ita`,INET_NTOA(`ip`) AS `ip`,`res` FROM `search_log` ORDER BY `timestamp` DESC LIMIT 256') + search_logs = FetchAll('SELECT `id`,`timestamp`,`keyword`,`ita`,INET_NTOA(`ip`) AS `ip`,`res` FROM `search_log` ORDER BY `timestamp` DESC LIMIT 256') for log in search_logs: #log['ip'] = str(inet_ntoa(log['ip'])) log['timestamp_formatted'] = formatTimestamp(log['timestamp']) diff --git a/cgi/templates/manage/basural.html b/cgi/templates/manage/basural.html new file mode 100644 index 0000000..f086558 --- /dev/null +++ b/cgi/templates/manage/basural.html @@ -0,0 +1,30 @@ + + + +
+
Salón de la vergüenza ajena
+ + + + + + + + + + + + + + + + + + + + +
IDOriginalBoardFechaMensaje
#{basura['id']}#{basura['origid']}#{basura['board']}#{basura['fecha']}#{basura['message']}[Eliminar]
+ +
+
+ -- cgit v1.2.1-18-gbd029