aboutsummaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorLibravatar TDavis 2019-03-30 01:43:05 -0300
committerLibravatar TDavis 2019-03-30 01:43:05 -0300
commit91cb8d7270b443229199d313f88bcd7175921aa3 (patch)
tree294e4246ae895205e708ef7f598e91d008a6ce84 /cgi
parentb46a78ff692bc922cb373f18dad4500891f1d641 (diff)
downloadweabot-91cb8d7270b443229199d313f88bcd7175921aa3.tar.gz
weabot-91cb8d7270b443229199d313f88bcd7175921aa3.tar.xz
weabot-91cb8d7270b443229199d313f88bcd7175921aa3.zip
Mover hilos fix 4 Test 2
Diffstat (limited to 'cgi')
-rw-r--r--cgi/manage.py25
1 files changed, 17 insertions, 8 deletions
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<br />" % 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 <br />" % (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 <br />" % (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])