list_long_page.py 898 B

123456789101112131415161718192021222324
  1. from .tool.func import *
  2. def list_long_page_2(conn, tool):
  3. curs = conn.cursor()
  4. curs.execute(db_change('select data from other where name = "count_all_title"'))
  5. if int(curs.fetchall()[0][0]) > 30000:
  6. return re_error('/error/25')
  7. div = '<ul class="inside_ul">'
  8. select_data = 'desc' if tool == 'long_page' else 'asc'
  9. title = 'long_page' if tool == 'long_page' else 'short_page'
  10. curs.execute(db_change("select title, length(data) from data order by length(data) " + select_data + " limit 50"))
  11. for data in curs.fetchall():
  12. div += '<li>' + str(data[1]) + ' : <a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a></li>'
  13. div += '</ul>'
  14. return easy_minify(flask.render_template(skin_check(),
  15. imp = [load_lang(title), wiki_set(), custom(), other2([0, 0])],
  16. data = div,
  17. menu = [['other', load_lang('return')]]
  18. ))