diff options
author | z411 | 2019-03-30 22:08:28 -0300 |
---|---|---|
committer | z411 | 2019-03-30 22:08:28 -0300 |
commit | b0217fa450e43286e1f0820195ad833bf97c2d98 (patch) | |
tree | 47f8de090b25292f5d7c1fed546aed979d923daf | |
parent | 4ae394f5dfd8d8024df7c8637ffb33891fc346e7 (diff) | |
download | weabot-b0217fa450e43286e1f0820195ad833bf97c2d98.tar.gz weabot-b0217fa450e43286e1f0820195ad833bf97c2d98.tar.xz weabot-b0217fa450e43286e1f0820195ad833bf97c2d98.zip |
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.
-rw-r--r-- | cgi/manage.py | 11 | ||||
-rw-r--r-- | cgi/post.py | 4 |
2 files changed, 4 insertions, 11 deletions
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") |