def ip_pas(conn, raw_ip): hide = 0 curs = conn.cursor() if (re.search("(\.|:)", raw_ip)): if (not re.search("^도구:", raw_ip)): curs.execute("select data from other where name = 'ip_view'") d = curs.fetchall() if (d and d[0][0] != ''): ip = '<span style="font-size: 75%;">' + hashlib.md5( bytes(raw_ip, 'utf-8')).hexdigest() + '</span>' if (not admin_check(conn, 'ban', None)): hide = 1 else: ip = raw_ip else: ip = raw_ip hide = 1 else: curs.execute("select title from data where title = ?", ['사용자:' + raw_ip]) if (curs.fetchall()): ip = '<a href="/w/' + url_pas('사용자:' + raw_ip) + '">' + raw_ip + '</a>' else: ip = '<a class="not_thing" href="/w/' + url_pas( '사용자:' + raw_ip) + '">' + raw_ip + '</a>' if (hide == 0): ip += ' <a href="/record/' + url_pas(raw_ip) + '">(기록)</a>' return (ip)
def other2(origin): div = '' session = request.environ.get('beaker.session') if (session.get('View_List')): match = re.findall('(?:(?:([^\n]+)\n))', session.get('View_List')) if (match): div = '' for data in match[-6:-1]: div += '<a href="/w/' + url_pas(data) + '">' + html.escape( data) + '</a> / ' div = re.sub(' / $', '', div) re_data = origin + [div] return (re_data)