list_please.py 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. from .tool.func import *
  2. def list_please_2():
  3. with get_db_connect() as conn:
  4. curs = conn.cursor()
  5. num = int(number_check(flask.request.args.get('num', '1')))
  6. sql_num = (num * 50 - 50) if num * 50 > 0 else 0
  7. curs.execute(db_change('select data from other where name = "count_all_title"'))
  8. if int(curs.fetchall()[0][0]) > 30000:
  9. return re_error('/error/25')
  10. div = '<ul class="inside_ul">'
  11. curs.execute(db_change("select distinct title, link from back where type = 'no' order by title asc limit ?, 50"), [sql_num])
  12. data_list = curs.fetchall()
  13. for data in data_list:
  14. div += '' + \
  15. '<li>' + \
  16. '<a id="not_thing" href="/w/' + url_pas(data[0]) + '">' + html.escape(data[0]) + '</a> ' + \
  17. '<a href="/w/' + url_pas(data[1]) + '">(' + html.escape(data[1]) + ')</a>' + \
  18. '</li>' + \
  19. ''
  20. div += '</ul>' + next_fix('/please?num=', num, data_list)
  21. return easy_minify(flask.render_template(skin_check(),
  22. imp = [load_lang('need_document'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
  23. data = div,
  24. menu = [['other', load_lang('return')]]
  25. ))