from .tool.func import * def topic_close_list_2(conn, name, tool): curs = conn.cursor() div = '' if flask.request.method == 'POST': t_num = '' while 1: curs.execute("select title from topic where title = ? and sub = ? limit 1", [name, flask.request.form.get('topic', None) + t_num]) if curs.fetchall(): if t_num == '': t_num = ' 2' else: t_num = ' ' + str(int(t_num.replace(' ', '')) + 1) else: break return redirect('/topic/' + url_pas(name) + '/sub/' + url_pas(flask.request.form.get('topic', 'test') + t_num)) else: plus = '' menu = [['topic/' + url_pas(name), load_lang('return')]] if tool == 'close': curs.execute("select sub from rd where title = ? and stop = 'O' order by sub asc", [name]) sub = load_lang('closed_discussion') elif tool == 'agree': curs.execute("select sub from rd where title = ? and agree = 'O' order by sub asc", [name]) sub = load_lang('agreed_discussion') else: curs.execute("select sub from rd where title = ? order by date desc", [name]) sub = load_lang('discussion_list') menu = [['w/' + url_pas(name), load_lang('document')]] plus = ''' (''' + load_lang('closed_discussion') + ''') (''' + load_lang('agreed_discussion') + ''')

''' t_num = 0 for data in curs.fetchall(): t_num += 1 curs.execute("select data, date, ip, block from topic where title = ? and sub = ? and id = '1'", [name, data[0]]) if curs.fetchall(): it_p = 0 if sub == load_lang('discussion_list'): curs.execute("select title from rd where title = ? and sub = ? and stop = 'O' order by sub asc", [name, data[0]]) if curs.fetchall(): it_p = 1 if it_p != 1: curs.execute("select id from topic where title = ? and sub = ? order by date desc limit 1", [name, data[0]]) t_data = curs.fetchall() div += '''

''' + str(t_num) + '''. ''' + data[0] + '''

''' if div == '': plus = re.sub('^
', '', plus) return easy_minify(flask.render_template(skin_check(), imp = [name, wiki_set(), custom(), other2([' (' + sub + ')', 0])], data = '
' + div + plus + '
', menu = menu ))