diff options
Diffstat (limited to 'cgi/post.py')
-rw-r--r-- | cgi/post.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cgi/post.py b/cgi/post.py index 96b7cab..a34bb39 100644 --- a/cgi/post.py +++ b/cgi/post.py @@ -22,6 +22,7 @@ class Post(object): "name": "", "tripcode": "", "email": "", + "posterid": "", "subject": "", "message": "", "password": "", @@ -137,7 +138,7 @@ def getThread(postid=0, mobile=False, timestamp=0): #thread = {"id": op_post["id"], "posts": [op_post], "omitted": 0, "omitted_img": 0} total_bytes += len(op_post["message"])+80 - replies = FetchAll("SELECT IS_DELETED, email, file, file_size, id, image_height, image_width, message, name, subject, thumb, thumb_height, thumb_width, timestamp_formatted, tripcode, parentid, locked, expires, expires_alert, expires_formatted, timestamp FROM `posts` WHERE `parentid` = %s AND `boardid` = %s ORDER BY `id` ASC", (op_post["id"], board["id"])) + replies = FetchAll("SELECT IS_DELETED, email, posterid, file, file_size, id, image_height, image_width, message, name, subject, thumb, thumb_height, thumb_width, timestamp_formatted, tripcode, parentid, locked, expires, expires_alert, expires_formatted, timestamp FROM `posts` WHERE `parentid` = %s AND `boardid` = %s ORDER BY `id` ASC", (op_post["id"], board["id"])) thread["length"] = 1 if replies: for reply in replies: @@ -408,7 +409,6 @@ def threadList(mode=0): timestamps = [] for thread in full_threads: if board['board_type'] == 1: - thread["timestamp_formatted"] = thread["timestamp_formatted"].split(" ")[0] timestamps.append([thread["last"], formatTimestamp(thread["last"])]) if mobile: timestamps[-1][1] = re.compile(r"\(.{1,3}\)", re.DOTALL | re.IGNORECASE).sub(" ", timestamps[-1][1]) @@ -1193,7 +1193,6 @@ def regenerateTrash(): posts = FetchAll("SELECT posts.id AS id, timestamp_formatted, posts.message AS message, boards.name AS board FROM `posts` INNER JOIN `boards` ON boardid = boards.id WHERE IS_DELETED = 2 AND timestamp > %s ORDER BY `timestamp` DESC", (int(time.time()) - 31557600*3,) ) for i in range(len(posts)): - posts[i]["timestamp_formatted"] = posts[i]["timestamp_formatted"].split()[0] posts[i]["message"] = formatting.remove_html(posts[i]["message"]) template_values = {'posts': posts} @@ -1306,7 +1305,7 @@ def archiveThread(postid): with open(Settings.ROOT_DIR + board["dir"] + "/kako/" + str(thread['timestamp']) + ".html", "w") as f: f.write(page) - thread['keys'] = ['num', 'IS_DELETED', 'name', 'tripcode', 'email', 'message', 'timestamp_formatted'] + thread['keys'] = ['num', 'IS_DELETED', 'name', 'tripcode', 'email', 'message', 'timestamp_formatted', 'posterid'] thread['posts'] = [[row[key] for key in thread['keys']] for row in thread['posts']] try: with open(Settings.ROOT_DIR + board["dir"] + "/kako/" + str(thread['timestamp']) + ".json", "w") as f: |