user_count_edit.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. from .tool.func import *
  2. def user_count_edit_2(conn, name):
  3. curs = conn.cursor()
  4. if name == None:
  5. that = ip_check()
  6. else:
  7. that = name
  8. curs.execute(db_change("select count(*) from history where ip = ?"), [that])
  9. count = curs.fetchall()
  10. if count:
  11. data = count[0][0]
  12. else:
  13. data = 0
  14. curs.execute(db_change("select count(*) from topic where ip = ?"), [that])
  15. count = curs.fetchall()
  16. if count:
  17. t_data = count[0][0]
  18. else:
  19. t_data = 0
  20. return easy_minify(flask.render_template(skin_check(),
  21. imp = [load_lang('count'), wiki_set(), wiki_custom(), wiki_css([0, 0])],
  22. data = '''
  23. <ul class="inside_ul">
  24. <li><a href="/record/''' + url_pas(that) + '''">''' + load_lang('edit_record') + '''</a> : ''' + str(data) + '''</li>
  25. <li><a href="/record/topic/''' + url_pas(that) + '''">''' + load_lang('discussion_record') + '''</a> : ''' + str(t_data) + '''</a></li>
  26. </ul>
  27. ''',
  28. menu = [['user', load_lang('return')]]
  29. ))