diff options
Diffstat (limited to 'cgi/manage.py')
-rw-r--r-- | cgi/manage.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/cgi/manage.py b/cgi/manage.py index ca1ace6..37546dc 100644 --- a/cgi/manage.py +++ b/cgi/manage.py @@ -193,8 +193,8 @@ def manage(self, path_split): threads = FetchAll("SELECT * FROM `posts` WHERE boardid = %s AND parentid = 0 ORDER BY `bumped` DESC" % board["id"]) template_filename = "mod.html" template_values = {"mode": 2, "dir": board["dir"], "threads": threads} - elif path_split[2] == "recent": - posts = FetchAll("SELECT posts.id, posts.subject, dir, boards.board_type, CASE parentid WHEN '0' THEN posts.id ELSE parentid END AS parentid, file, thumb, timestamp_formatted, timestamp, posts.message, INET6_NTOA(ip) AS ip, posts.name, email, tripcode, boards.name AS board_name FROM posts INNER JOIN boards ON posts.boardid = boards.id WHERE posts.timestamp > UNIX_TIMESTAMP() - 86400 ORDER BY timestamp DESC") + elif path_split[2] == 'recent': + posts = FetchAll("SELECT posts.id, posts.subject, dir, boards.board_type, CASE parentid WHEN '0' THEN posts.id ELSE parentid END AS parentid, file, thumb, timestamp_formatted, timestamp, posts.message, INET6_NTOA(ip) AS ip, posts.name, email, tripcode, posts.IS_DELETED, boards.name AS board_name FROM posts INNER JOIN boards ON posts.boardid = boards.id WHERE posts.timestamp > UNIX_TIMESTAMP() - 86400 ORDER BY timestamp DESC") template_filename = "recent.html" template_values = {"posts": posts} elif path_split[2] == 'staff': @@ -1581,8 +1581,7 @@ def manage(self, path_split): 'submit': submit} elif len(path_split) > 4 and path_split[3] == 'delete': delid = int(path_split[4]) - UpdateDb( - "DELETE FROM `filters` WHERE id = '%s' LIMIT 1" % str(delid)) + UpdateDb("DELETE FROM `filters` WHERE id = '%s' LIMIT 1", str(delid)) message = _('Deleted filter %s.') % str(delid) template_filename = "message.html" action_taken = True @@ -1991,19 +1990,18 @@ def manage(self, path_split): template_values = {'boards': boardlist()} elif path_split[2] == 'goto': board = setBoard(path_split[3]) - board_type = board['board_type'] try: pid = int(path_split[4]) except ValueError: raise UserError("ID no vĂ¡lida.") - if board_type == '1': + if board['board_type'] == 1: first = get_parent_post(pid, board['id']) - url = "/" + board['dir'] + "/read/" + first['timestamp'] + "/" + url = "/%s/read/%s/" % (board['dir'], first['timestamp']) else: - url = "/" + board['dir'] + "/res/" + str(pid) + ".html" - + url = "/%s/res/%s.html" % (board['dir'], pid) + self.output = '<meta http-equiv="refresh" content="0;url=%s" />' % url elif path_split[2] == 'fixquote': # when a mod deletes a post permanently messing with quote numbers |