aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Choom 2023-01-25 23:10:33 -0300
committerLibravatar Choom 2023-01-26 01:25:21 -0300
commite396b01348126c1b8d5c3a93cb90bc309046f8e7 (patch)
treed08d485269b1bec95a7e6f16ce6fb1e9b9fc332a
parent1abcb963bf5cceacf76c4244f6b6326360730063 (diff)
downloadweabot-e396b01348126c1b8d5c3a93cb90bc309046f8e7.tar.gz
weabot-e396b01348126c1b8d5c3a93cb90bc309046f8e7.tar.xz
weabot-e396b01348126c1b8d5c3a93cb90bc309046f8e7.zip
Cambiando datos archivados a int
-rw-r--r--cgi/manage.py33
-rw-r--r--cgi/templates/txt_archive.html6
2 files changed, 25 insertions, 14 deletions
diff --git a/cgi/manage.py b/cgi/manage.py
index cd1a215..5634a49 100644
--- a/cgi/manage.py
+++ b/cgi/manage.py
@@ -1398,8 +1398,6 @@ def manage(self, path_split):
if not administrator:
return
- return
-
board = setBoard(path_split[3])
threads = FetchAll('SELECT * FROM archive WHERE boardid = %s ORDER BY timestamp DESC' % board['id'])
@@ -1416,7 +1414,20 @@ def manage(self, path_split):
with open(fname) as f:
thread = json.load(f)
- #thread['posts'] = [dict(list(zip(thread['keys'], row))) for row in thread['posts']]
+ thread['posts'] = [dict(list(zip(thread['keys'], row))) for row in thread['posts']]
+
+ thread.pop('omitted', None)
+ thread.pop('omitted_img', None)
+
+ #for post in thread['posts']:
+ # #if post['IS_DELETED'] > 0:
+ # # #vaciar campos si está borrado
+ # # post['name'] = 'muerto'
+ # # post['tripcode'] = ''
+ # # post['email'] = ''
+ # # post['message'] = '...'
+ # # post['timestamp_formatted'] = 'nunca'
+ # # post['posterid'] = ''
#if 'posterid' not in thread['keys']:
# for post in thread['posts']:
@@ -1428,20 +1439,20 @@ def manage(self, path_split):
# post['posterid'] = ''
#
# thread['keys'].append('posterid')
-
+ #
#if 'message' not in thread:
# thread['message'] = thread['posts'][0]['message']
# thread['keys'].append('message')
- #thread['posts'] = [[row[key] for key in thread['keys']] for row in thread['posts']]
+ thread['posts'] = [[row[key] for key in thread['keys']] for row in thread['posts']]
- ##raise UserError(thread)
+ raise UserError(thread)
- #try:
- # with open(fname, "w") as f:
- # json.dump(thread, f, indent=0)
- #except:
- # raise UserError("Can't edit")
+ try:
+ with open(fname, "w") as f:
+ json.dump(thread, f, indent=0)
+ except:
+ raise UserError("Can't edit")
thread['posts'] = [dict(list(zip(thread['keys'], row))) for row in thread['posts']]
diff --git a/cgi/templates/txt_archive.html b/cgi/templates/txt_archive.html
index fe7f8c6..bdac2ca 100644
--- a/cgi/templates/txt_archive.html
+++ b/cgi/templates/txt_archive.html
@@ -15,10 +15,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="stylesheet" href="/static/css/txt/bbs.css" />
-<?py if not force_css: ?>
- <link rel="stylesheet" id="css" href="#{static_url}css/txt/#{txt_styles[txt_styles_default].lower()}.css" />
+<?py if board == 'zonavip' and threads[0]['timestamp'] < 1377934149: ?>
+ <link rel="stylesheet" id="css" href="#{static_url}css/txt/baisano.css" />
<?py else: ?>
- <link rel="stylesheet" type="text/css" href="#{force_css}" />
+ <link rel="stylesheet" id="css" href="#{static_url}css/txt/#{txt_styles[txt_styles_default].lower()}.css" />
<?py #endif ?>
<script type="text/javascript" src="#{static_url}js/weabotxt.js"></script>
<script type="text/javascript" src="#{static_url}js/aquiencitas.js"></script>