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: ban = '' select = '' sub = '' div = ''' ''' num = int(number_check(flask.request.args.get('num', '1'))) if num * 50 > 0: sql_num = num * 50 - 50 else: sql_num = 0 if name: if tool == 'history': sub += ' (' + load_lang('history') + ')' div += ''' ''' tool_select = flask.request.args.get('tool', 'normal') if tool_select == 'move': plus_sql = 'where (send like ? or send like ?) and type = "" ' plus_list = ['%(' + name +'%', '%' + name + ' move)', sql_num] sub += ' (' + load_lang('move') + ')' elif tool_select == 'delete': plus_sql = 'where (send like "%(delete)") and title = ? and type = "" ' plus_list = [name, sql_num] sub += ' (' + load_lang('revert') + ')' elif tool_select == 'revert': plus_sql = 'where (send like ?) and title = ? and type = "" ' plus_list = ['%(r%)', name, sql_num] sub += ' (' + load_lang('revert') + ')' else: plus_sql = 'where title = ? and type = "" ' plus_list = [name, sql_num] curs.execute(db_change('' + \ 'select id, title, date, ip, send, leng from history ' + \ plus_sql + \ 'order by id + 0 desc ' + \ "limit ?, 50" + \ ''), plus_list) else: div += ''' ''' div = '(' + load_lang('discussion') + ')
' + div curs.execute(db_change('' + \ 'select id, title, date, ip, send, leng from history ' + \ "where ip = ? and type = '' order by date desc limit ?, 50" + \ ''), [name, sql_num]) else: div += ''' ''' set_type = flask.request.args.get('set', 'normal') if set_type == 'normal': div = '' + \ '(' + load_lang('user_document') + ') ' + \ '(' + load_lang('edit_req') + ')' + \ '
' + div + \ '' if set_type == 'req': plus_sql = "where type = 'req' " elif set_type == 'user': plus_sql = "where title like 'user:%' and type = '' " else: plus_sql = "where not title like 'user:%' and type = '' " curs.execute(db_change('' + \ 'select id, title, date, ip, send, leng from history ' + \ plus_sql + \ 'order by date desc ' + \ 'limit ?, 50' + \ ''), [sql_num]) div += '' 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]) if tool == 'history': m_tool = '(' + load_lang('tool') + ')' else: m_tool = '(' + load_lang('tool') + ')' style = ['', ''] date = data[2] curs.execute(db_change(''' select title from history where title = ? and id = ? and hide = 'O' '''), [data[1], data[0]]) hide = curs.fetchall() if admin_check(6) == 1: if hide: style[0] = 'id="toron_color_grey"' style[1] = 'id="toron_color_grey"' 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: if not name and set_type == 'req': title = '' + html.escape(data[1]) + ' (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) + '''
''' if name: if tool == 'history': if not tool_select: div = '' + \ '(' + load_lang('move') + ') ' + \ '(' + load_lang('delete') + ') ' + \ '(' + load_lang('revert') + ')' + \ '
' + div + \ '' menu = [['w/' + url_pas(name), load_lang('document')], ['raw/' + url_pas(name), load_lang('raw')]] else: menu = [['history/' + url_pas(name), load_lang('return')]] div = '''

''' + div title = name div += next_fix('/history/' + url_pas(name) + '?tool=' + tool_select + '&num=', num, data_list) else: 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?set=' + set_type + '&num=', num, data_list) if set_type == 'user': sub = ' (' + load_lang('user') + ')' menu = [['recent_changes', load_lang('return')]] elif set_type == 'req': sub = ' (' + load_lang('edit_req') + ')' 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 ))