from .tool.func import *
async def topic_comment_tool(topic_num = 1, num = 1):
with get_db_connect() as conn:
curs = conn.cursor()
num = str(num)
topic_num = str(topic_num)
if await acl_check('', 'topic_view', topic_num) == 1:
return await re_error(conn, 0)
curs.execute(db_change("select block, ip, date from topic where code = ? and id = ?"), [topic_num, num])
data = curs.fetchall()
if not data:
return redirect(conn, '/thread/' + topic_num)
ban = '''
''' + await get_lang('state') + '''
- ''' + await get_lang('writer') + ' : ''' + await ip_pas(data[0][1]) + '''
- ''' + await get_lang('time') + ' : ' + data[0][2] + '''
''' + await get_lang('other_tool') + '''
'''
if await acl_check(tool = 'toron_auth') != 1:
ban += '''
''' + await get_lang('admin_tool') + '''
'''
return easy_minify(flask.render_template(await skin_check(),
imp = [await get_lang('discussion_tool'), await wiki_set(), await wiki_custom(conn), wiki_css(['(#' + num + ')', 0])],
data = ban,
menu = [['thread/' + topic_num + '#' + num, await get_lang('return')]]
))