list_old_page.py 1.2 KB

12345678910111213141516171819202122232425262728
  1. from .tool.func import *
  2. def list_old_page(num = 1):
  3. with get_db_connect() as conn:
  4. curs = conn.cursor()
  5. # 리다이렉트 구분도 넣을 예정
  6. # 그 전에 로직 개편하고
  7. sql_num = (num * 50 - 50) if num * 50 > 0 else 0
  8. curs.execute(db_change('select data from other where name = "count_all_title"'))
  9. if int(curs.fetchall()[0][0]) > 30000:
  10. return re_error('/error/25')
  11. div = '<ul class="opennamu_ul">'
  12. curs.execute(db_change("select doc_name, set_data from data_set where set_name = 'last_edit' and doc_rev = '' order by set_data asc limit ?, 50"), [sql_num])
  13. n_list = curs.fetchall()
  14. for data in n_list:
  15. div += '<li>' + data[1] + ' | <a href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a></li>'
  16. div += '</ul>' + next_fix('/list/document/old/', num, n_list)
  17. return easy_minify(flask.render_template(skin_check(),
  18. imp = [load_lang('old_page'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
  19. data = div,
  20. menu = [['other', load_lang('return')]]
  21. ))