from .tool.func import *
def list_user_topic_2(conn, name):
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
div = '''
| ''' + load_lang('discussion_name') + ''' |
''' + load_lang('writer') + ''' |
''' + load_lang('time') + ''' |
'''
curs.execute(db_change("select code, id, ip, date from topic where ip = ? order by date desc limit ?, 50"), [name, sql_num])
data_list = curs.fetchall()
for data in data_list:
title = html.escape(data[0])
sub = html.escape(data[2])
curs.execute(db_change("select title, sub from rd where code = ?"), [data[0]])
other_data = curs.fetchall()
div += '| ' + other_data[0][1] + '#' + data[1] + ' (' + other_data[0][0] + ') | '
div += '' + ip_pas(data[2]) + ' | ' + data[3] + ' |
'
div += '
'
div += next_fix('/topic_record/' + url_pas(name) + '?num=', num, data_list)
return easy_minify(flask.render_template(skin_check(),
imp = [load_lang('discussion_record'), wiki_set(), custom(), other2([sub, 0])],
data = div,
menu = [['other', load_lang('other')], ['user', load_lang('user')], ['count/' + url_pas(name), load_lang('count')], ['record/' + url_pas(name), load_lang('record')]]
))