from .tool.func import * def recent_changes_2(conn, name, tool): curs = conn.cursor() if flask.request.method == 'POST': return redirect( '/diff/' + url_pas(name) + '?first=' + flask.request.form.get('b', '1') + '&second=' + flask.request.form.get('a', '1') ) else: one_admin = admin_check(1) six_admin = admin_check(6) ban = '' select = '' div = '''
''' if name: num = int(number_check(flask.request.args.get('num', '1'))) if num * 50 > 0: sql_num = num * 50 - 50 else: sql_num = 0 if tool == 'history': div += ''' ''' # 기본적인 move만 구현 tool_select = flask.request.args.get('tool', None) if tool_select: if tool_select == 'move': curs.execute(''' select id, title, date, ip, send, leng from history where send like ? or send like ? order by id + 0 desc limit ?, '50' ''', ['%(' + name +'%', '%' + name + ' move)', str(sql_num)]) else: curs.execute(''' select id, title, date, ip, send, leng from history where title = ? order by id + 0 desc limit ?, '50' ''', [name, str(sql_num)]) else: curs.execute(''' select id, title, date, ip, send, leng from history where title = ? order by id + 0 desc limit ?, '50' ''', [name, str(sql_num)]) else: div += ''' ''' div = '(' + load_lang('discussion') + ')
' + div curs.execute("select id, title, date, ip, send, leng from history where ip = ? order by date desc limit ?, '50'", [name, str(sql_num)]) else: num = int(number_check(flask.request.args.get('num', '1'))) if num * 50 > 0: sql_num = num * 50 - 50 else: sql_num = 0 div += ''' ''' if flask.request.args.get('set', 'normal') == 'user': curs.execute(''' select id, title, date, ip, send, leng from history where title like 'user:%' order by date desc limit ?, 50 ''', [str(sql_num)]) else: div = '(' + load_lang('user_document') + ')' + div curs.execute(''' select id, title, date, ip, send, leng from history where not title like 'user:%' order by date desc limit ?, 50 ''', [str(sql_num)]) data_list = curs.fetchall() for data in data_list: select += '' send = '
' if data[4]: if not re.search("^(?: *)$", data[4]): send = data[4] if re.search("\+", data[5]): leng = '(' + data[5] + ')' elif re.search("\-", data[5]): leng = '(' + data[5] + ')' else: leng = '(' + data[5] + ')' ip = ip_pas(data[3]) m_tool = '(' + load_lang('tool') + ')' style = ['', ''] date = data[2] curs.execute(''' select title from history where title = ? and id = ? and hide = 'O' ''', [data[1], data[0]]) hide = curs.fetchall() if six_admin == 1: if hide: style[0] = 'id="toron_color_grey"' style[1] = 'id="toron_color_grey"' if send == '
': send = '(' + load_lang('hide') + ')' else: send += ' (' + load_lang('hide') + ')' elif not hide: pass else: ip = '' ban = '' date = '' send = '(' + load_lang('hide') + ')' style[0] = 'style="display: none;"' style[1] = 'id="toron_color_grey"' if tool == 'history': title = 'r' + data[0] + ' ' else: title = '' + html.escape(data[1]) + ' ' title += '(r' + data[0] + ') ' div += ''' ''' div += '''
''' + load_lang('version') + ''' ''' + load_lang('editor') + ''' ''' + load_lang('time') + '''
''' + load_lang('document_name') + ''' ''' + load_lang('editor') + ''' ''' + load_lang('time') + '''
''' + load_lang('document_name') + ''' ''' + load_lang('editor') + ''' ''' + load_lang('time') + '''
''' + title + m_tool + ' ' + leng + ''' ''' + ip + ban + ''' ''' + date + '''
''' + send_parser(send) + '''
''' sub = '' if name: if tool == 'history': if not tool_select: div = ''' (''' + load_lang('move') + ''')
''' + div div = '''

''' + div title = name sub += ' (' + load_lang('history') + ')' menu = [['w/' + url_pas(name), load_lang('document')], ['raw/' + url_pas(name), load_lang('raw')]] div += next_fix('/history/' + url_pas(name) + '?num=', num, data_list) else: curs.execute("select end from ban where block = ?", [name]) if curs.fetchall(): sub += ' (' + load_lang('blocked') + ')' title = load_lang('edit_record') menu = [['other', load_lang('other')], ['user', load_lang('user')], ['count/' + url_pas(name), load_lang('count')]] div += next_fix('/record/' + url_pas(name) + '?num=', num, data_list) else: menu = 0 title = load_lang('recent_change') div += next_fix('/recent_changes?num=', num, data_list) if flask.request.args.get('set', 'normal') == 'user': sub = ' (' + load_lang('user') + ')' menu = [['recent_changes', load_lang('return')]] if sub == '': sub = 0 return easy_minify(flask.render_template(skin_check(), imp = [title, wiki_set(), custom(), other2([sub, 0])], data = div, menu = menu ))