From 91cb8d7270b443229199d313f88bcd7175921aa3 Mon Sep 17 00:00:00 2001 From: TDavis Date: Sat, 30 Mar 2019 01:43:05 -0300 Subject: Mover hilos fix 4 Test 2 --- cgi/manage.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'cgi') diff --git a/cgi/manage.py b/cgi/manage.py index ea7d0e3..a92bf01 100644 --- a/cgi/manage.py +++ b/cgi/manage.py @@ -466,10 +466,19 @@ def manage(self, path_split): if post['subject'] and post['subject'] == oldboardsubject: post['subject'] = board['subject'] - # fix nameless posts + # fix new default name if post['name'] == oldboardname: post['name'] = board['anonymous'] + # fix date and (re)add post ID if necessary + post['timestamp_formatted'] = formatTimestamp(post['timestamp']) + if board["useid"] != '0': + if post["parentid"]: + t = parent_post["timestamp"] + else: + t = post["timestamp"] + post['timestamp_formatted'] += ' ID:' + iphash(post['ip'], post, t, False, False, False, False, (board["countrycode"] in ['1', '2'])) + # insert new post and get its new ID new_id = post.insert() @@ -1189,13 +1198,13 @@ def manage(self, path_split): posts = FetchAll('SELECT * FROM `posts` WHERE `boardid` = %s' % board['id']) self.output = "total: %d
" % len(posts) for post in posts: - new_timestamp_formatted = formatTimestamp(post['timestamp']) - tim = 0 - if board["useid"] != '0': - new_timestamp_formatted += ' ID:' + iphash(post['ip'], '', tim, '1', False, False, False, '0') - self.output += "%s - %s
" % (post['id'], new_timestamp_formatted) - query = "UPDATE `posts` SET timestamp_formatted = '%s' WHERE boardid = '%s' AND id = '%s'" % (new_timestamp_formatted, board['id'], post['id']) - UpdateDb(query) + new_timestamp_formatted = formatTimestamp(post['timestamp']) + tim = 0 + if board["useid"] != '0': + new_timestamp_formatted += ' ID:' + iphash(post['ip'], '', tim, '1', False, False, False, '0') + self.output += "%s - %s
" % (post['id'], new_timestamp_formatted) + query = "UPDATE `posts` SET timestamp_formatted = '%s' WHERE boardid = '%s' AND id = '%s'" % (new_timestamp_formatted, board['id'], post['id']) + UpdateDb(query) return elif path_split[2] == 'fixname': board = setBoard(path_split[3]) -- cgit v1.2.1-18-gbd029