from .tool.func import * def recent_discuss_2(conn, tool): curs = conn.cursor() div = '' if tool == 'normal': div += '(' + load_lang('close_discussion') + ') ' div += '(' + load_lang('open_discussion_list') + ')' m_sub = 0 elif tool == 'close': div += '(' + load_lang('normal') + ')' m_sub = ' (' + load_lang('closed') + ')' else: div += '(' + load_lang('normal') + ')' m_sub = ' (' + load_lang('open_discussion_list') + ')' div += '''
''' if tool == 'normal': curs.execute(db_change("select title, sub, date, code from rd where not stop = 'O' order by date desc limit 50")) elif tool == 'close': curs.execute(db_change("select title, sub, date, code from rd where stop = 'O' order by date desc limit 50")) else: curs.execute(db_change('select title, sub, date, code from rd where stop != "O" order by date asc limit 50')) for data in curs.fetchall(): div += '' + \ '' + \ '' + \ '' + \ '' + \ '' div += '
''' + load_lang('discussion_name') + ''' ''' + load_lang('time') + '''
' + \ '' + html.escape(data[1]) + ' ' + \ '(' + html.escape(data[0]) + ')' + \ '' + data[2] + '
' return easy_minify(flask.render_template(skin_check(), imp = [load_lang('recent_discussion'), wiki_set(), wiki_custom(), wiki_css([m_sub, 0])], data = div, menu = 0 ))