Surplus_Up (2DU) 5 лет назад
Родитель
Сommit
e334e25469
6 измененных файлов с 37 добавлено и 6 удалено
  1. 5 1
      app.py
  2. 2 0
      language/en-US.json
  3. 3 1
      language/ko-KR.json
  4. 24 0
      route/list_long_page.py
  5. 1 4
      route/list_please.py
  6. 2 0
      route/main_other.py

+ 5 - 1
app.py

@@ -131,7 +131,7 @@ load_conn(conn)
 
 # DB init
 create_data = {}
-create_data['data'] = ['title', 'data']
+create_data['data'] = ['title', 'data', 'type']
 create_data['cache_data'] = ['title', 'data', 'id']
 create_data['history'] = ['id', 'title', 'data', 'date', 'ip', 'send', 'leng', 'hide', 'type']
 create_data['rc'] = ['id', 'title', 'date', 'type']
@@ -604,6 +604,10 @@ def func_upload():
 def user_info():
     return user_info_2(conn)
 
+@app.route('/<regex("long_page|short_page"):tool>')
+def list_long_page(tool = 'long_page'):
+    return list_long_page_2(conn, tool)
+
 @app.route('/<regex("watch_list|star_doc"):tool>')
 def watch_list(tool = 'star_doc'):
     return watch_list_2(conn, tool)

+ 2 - 0
language/en-US.json

@@ -301,6 +301,8 @@
             "all_document_list" : "All document(s) list",
             "watchlist" : "Watchlist",
             "image_file_list" : "Image file(s) list",
+            "short_page" : "Short page(s) list",
+            "long_page" : "Long page(s) list",
             "_comment_2.3.1_" : "ACL document list",
                 "acl_document_list" : "ACL document(s) list",
                 "acl_required" : "Required ACL",

+ 3 - 1
language/ko-KR.json

@@ -397,5 +397,7 @@
     "upload_help" : "파일 올리기 문구",
     "upload_default" : "파일 기타란 기본값",
     "same_email_error" : "동일한 이메일을 사용하는 사용자가 있습니다.",
-    "input_email_error" : "입력 값에 문제가 있습니다."
+    "input_email_error" : "입력 값에 문제가 있습니다.",
+    "short_page" : "짧은 문서 목록",
+    "long_page" : "긴 문서 목록"
 }

+ 24 - 0
route/list_long_page.py

@@ -0,0 +1,24 @@
+from .tool.func import *
+
+def list_long_page_2(conn, tool):
+    curs = conn.cursor()
+
+    curs.execute(db_change('select data from other where name = "count_all_title"'))
+    if int(curs.fetchall()[0][0]) > 30000:
+        return re_error('/error/25')
+
+    div = '<ul>'
+    select_data = 'desc' if tool == 'long_page' else 'asc'
+    title = 'long_page' if tool == 'long_page' else 'short_page'
+
+    curs.execute(db_change("select title, length(data) from data order by length(data) " + select_data + " limit 50"))
+    for data in curs.fetchall():
+        div += '<li>' + str(data[1]) + ' : <a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
+
+    div += '</ul>'
+
+    return easy_minify(flask.render_template(skin_check(),
+        imp = [load_lang(title), wiki_set(), custom(), other2([0, 0])],
+        data = div,
+        menu = [['other', load_lang('return')]]
+    ))

+ 1 - 4
route/list_please.py

@@ -4,10 +4,7 @@ def list_please_2(conn):
     curs = conn.cursor()
 
     num = int(number_check(flask.request.args.get('num', '1')))
-    if num * 50 > 0:
-        sql_num = num * 50 - 50
-    else:
-        sql_num = 0
+    sql_num = (num * 50 - 50) if num * 50 > 0 else 0
 
     curs.execute(db_change('select data from other where name = "count_all_title"'))
     if int(curs.fetchall()[0][0]) > 30000:

+ 2 - 0
route/main_other.py

@@ -27,6 +27,8 @@ def main_other_2(conn):
                 <li><a href="/old_page">''' + load_lang('old_page') + '''</a></li>
                 <li><a href="/image_file_list">''' + load_lang('image_file_list') + '''</a></li>
                 <li><a href="/vote">''' + load_lang('vote_list') + '''</a></li>
+                <li><a href="/long_page">''' + load_lang('long_page') + '''</a></li>
+                <!-- <li><a href="/short_page">''' + load_lang('short_page') + '''</a></li> -->
             </ul>
             <br>
             <h2>''' + load_lang('other') + '''</h2>