From b0217fa450e43286e1f0820195ad833bf97c2d98 Mon Sep 17 00:00:00 2001 From: z411 Date: Sat, 30 Mar 2019 22:08:28 -0300 Subject: Ahora los textboards tambiƩn usan `res` como res dir. Nunca hubo necesidad de cambiarlo a `read` ya que se hace un Rewrite de todas maneras. --- cgi/manage.py | 11 ++--------- cgi/post.py | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'cgi') diff --git a/cgi/manage.py b/cgi/manage.py index 9ac2006..3df0f77 100644 --- a/cgi/manage.py +++ b/cgi/manage.py @@ -1836,28 +1836,21 @@ def switchBoard(new_type): return kako_dir = os.path.join(Settings.ROOT_DIR, board['dir'], 'kako') + res_dir = os.path.join(Settings.ROOT_DIR, board['dir'], 'res') if new_type == '0': # Switching to Imageboard - old_res_dir = os.path.join(Settings.ROOT_DIR, board['dir'], 'read') - new_res_dir = os.path.join(Settings.ROOT_DIR, board['dir'], 'res') - # Delete kako if empty if os.path.exists(kako_dir) and not os.listdir(kako_dir): os.rmdir(kako_dir) elif new_type == '1': # Switching to Textboard - old_res_dir = os.path.join(Settings.ROOT_DIR, board['dir'], 'res') - new_res_dir = os.path.join(Settings.ROOT_DIR, board['dir'], 'read') - # Make kako dir if not os.path.exists(kako_dir): os.mkdir(kako_dir) - - os.rename(old_res_dir, new_res_dir) # Clean res dir - cleanDir(new_res_dir, ext="html") + cleanDir(res_dir, ext="html") def logAction(staff, action): InsertDb("INSERT INTO `logs` (`timestamp`, `staff`, `action`) VALUES (" + str(timestamp()) + ", '" + _mysql.escape_string(staff) + "\', \'" + _mysql.escape_string(action) + "\')") diff --git a/cgi/post.py b/cgi/post.py index 4d4c598..d129715 100644 --- a/cgi/post.py +++ b/cgi/post.py @@ -477,7 +477,7 @@ def regenerateThreadPage(postid): if board['board_type'] in ['1', '5']: template_filename = "txt_thread.html" - outname = Settings.ROOT_DIR + board["dir"] + "/read/" + str(thread["timestamp"]) + ".html" + outname = Settings.ROOT_DIR + board["dir"] + "/res/" + str(thread["timestamp"]) + ".html" title_matome = thread['subject'] post_preview = cut_home_msg(thread['posts'][0]['message'], 0) else: @@ -722,7 +722,7 @@ def deletePost(postid, password, deltype='0', imageonly=False, quick=False): if post['parentid'] == '0': if board['board_type'] == '1': - os.unlink(Settings.ROOT_DIR + board["dir"] + "/read/" + post["timestamp"] + ".html") + os.unlink(Settings.ROOT_DIR + board["dir"] + "/res/" + post["timestamp"] + ".html") else: os.unlink(Settings.ROOT_DIR + board["dir"] + "/res/" + post["id"] + ".html") -- cgit v1.2.1-18-gbd029