from .tool.func import * def recent_record_topic(name = 'Test'): with get_db_connect() as conn: curs = conn.cursor() num = int(number_check(flask.request.args.get('num', '1'))) sql_num = (num * 50 - 50) if num * 50 > 0 else 0 div = ''' ''' sub = '(' + html.escape(name) + ')' pas_name = ip_pas(name) curs.execute(db_change("select code, id, 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]) curs.execute(db_change("select title, sub from rd where code = ?"), [data[0]]) other_data = curs.fetchall() div += '' + \ '' + \ '' + \ '' + \ '' + \ '' + \ '' div += '
''' + load_lang('discussion_name') + ''' ''' + load_lang('writer') + ''' ''' + load_lang('time') + '''
' + \ '' + other_data[0][1] + '#' + data[1] + ' (' + other_data[0][0] + ')' + \ '' + pas_name + '' + data[2] + '
' div += next_fix('/record/topic/' + url_pas(name) + '?num=', num, data_list) return easy_minify(flask.render_template(skin_check(), imp = [load_lang('discussion_record'), wiki_set(), wiki_custom(), wiki_css([sub, 0])], data = div, menu = [['other', load_lang('other')], ['user/' + url_pas(name), load_lang('user_tool')]] ))