from .tool.func import *
def recent_discuss_2(conn):
curs = conn.cursor()
div = ''
if flask.request.args.get('what', 'normal') == 'normal':
div += '(' + load_lang('close_discussion') + ')'
m_sub = 0
else:
div += '(' + load_lang('open_discussion') + ')'
m_sub = ' (' + load_lang('closed') + ')'
div += '''
| ''' + load_lang('discussion_name') + ''' |
''' + load_lang('time') + ''' |
'''
if m_sub == 0:
curs.execute(db_change("select title, sub, date, code from rd where not 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 desc limit 50"))
for data in curs.fetchall():
title = html.escape(data[0])
sub = html.escape(data[1])
div += '| ' + sub + ' (' + title + ') | ' + data[2] + ' |
'
div += '
'
return easy_minify(flask.render_template(skin_check(),
imp = [load_lang('recent_discussion'), wiki_set(), custom(), other2([m_sub, 0])],
data = div,
menu = 0
))