|
@@ -1559,37 +1559,43 @@ def backlink(name = None, number = None):
|
|
|
div = div + '<br><a href="/backlink/n/' + str(number - 1) + '">(이전)'
|
|
div = div + '<br><a href="/backlink/n/' + str(number - 1) + '">(이전)'
|
|
|
break
|
|
break
|
|
|
|
|
|
|
|
- curs.execute("select * from data where title = '" + pymysql.escape_string(rows[i]['link']) + "'")
|
|
|
|
|
- row = curs.fetchall()
|
|
|
|
|
- if(row):
|
|
|
|
|
- aa = row[0]['data']
|
|
|
|
|
- aa = re.sub("(?P<in>\[include\((?P<out>(?:(?!\)\]|,).)*)((?:,\s?(?:[^)]*))+)?\)\])", "\g<in>\n\n[[\g<out>]]\n\n", aa)
|
|
|
|
|
- aa = re.sub('^#(?:redirect|넘겨주기)\s(?P<in>[^\n]*)', '[[\g<in>]]', aa)
|
|
|
|
|
- aa = namumark('', aa)
|
|
|
|
|
-
|
|
|
|
|
- if(re.search("<a(?: class=\"not_thing\")? href=\"\/w\/" + parse.quote(name).replace('/','%2F') + "(?:\#[^\"]*)?\">([^<]*)<\/a>", aa)):
|
|
|
|
|
- div = div + '<li><a href="/w/' + parse.quote(rows[i]['link']).replace('/','%2F') + '">' + rows[i]['link'] + '</a>'
|
|
|
|
|
|
|
+ if(not re.search('^사용자:', rows[i]['link'])):
|
|
|
|
|
+ curs.execute("select * from data where title = '" + pymysql.escape_string(rows[i]['link']) + "'")
|
|
|
|
|
+ row = curs.fetchall()
|
|
|
|
|
+ if(row):
|
|
|
|
|
+ aa = row[0]['data']
|
|
|
|
|
+ aa = re.sub("(?P<in>\[include\((?P<out>(?:(?!\)\]|,).)*)((?:,\s?(?:[^)]*))+)?\)\])", "\g<in>\n\n[[\g<out>]]\n\n", aa)
|
|
|
|
|
+ aa = re.sub('^#(?:redirect|넘겨주기)\s(?P<in>[^\n]*)', '[[\g<in>]]', aa)
|
|
|
|
|
+ aa = namumark('', aa)
|
|
|
|
|
|
|
|
- if(rows[i]['type']):
|
|
|
|
|
- div = div + ' (' + rows[i]['type'] + ')</li>'
|
|
|
|
|
- else:
|
|
|
|
|
- div = div + '</li>'
|
|
|
|
|
|
|
+ if(re.search("<a(?: class=\"not_thing\")? href=\"\/w\/" + parse.quote(name).replace('/','%2F') + "(?:\#[^\"]*)?\">([^<]*)<\/a>", aa)):
|
|
|
|
|
+ div = div + '<li><a href="/w/' + parse.quote(rows[i]['link']).replace('/','%2F') + '">' + rows[i]['link'] + '</a>'
|
|
|
|
|
|
|
|
- if(i == v):
|
|
|
|
|
- if(number == 1):
|
|
|
|
|
- div = div + '<br><a href="/backlink/' + parse.quote(name).replace('/','%2F') + '/n/' + str(number + 1) + '">(다음)'
|
|
|
|
|
|
|
+ if(rows[i]['type']):
|
|
|
|
|
+ div = div + ' (' + rows[i]['type'] + ')</li>'
|
|
|
else:
|
|
else:
|
|
|
- div = div + '<br><a href="/backlink/' + parse.quote(name).replace('/','%2F') + '/n/' + str(number - 1) + '">(이전) <a href="/userlog/n/' + str(number + 1) + '">(다음)'
|
|
|
|
|
- break
|
|
|
|
|
|
|
+ div = div + '</li>'
|
|
|
|
|
+
|
|
|
|
|
+ if(i == v):
|
|
|
|
|
+ if(number == 1):
|
|
|
|
|
+ div = div + '<br><a href="/backlink/' + parse.quote(name).replace('/','%2F') + '/n/' + str(number + 1) + '">(다음)'
|
|
|
|
|
+ else:
|
|
|
|
|
+ div = div + '<br><a href="/backlink/' + parse.quote(name).replace('/','%2F') + '/n/' + str(number - 1) + '">(이전) <a href="/backlink/' + parse.quote(name).replace('/','%2F') + '/n/' + str(number + 1) + '">(다음)'
|
|
|
|
|
+ break
|
|
|
|
|
+ else:
|
|
|
|
|
+ i = i + 1
|
|
|
else:
|
|
else:
|
|
|
|
|
+ curs.execute("delete from back where title = '" + pymysql.escape_string(name) + "' and link = '" + pymysql.escape_string(rows[i]['link']) + "'")
|
|
|
|
|
+ conn.commit()
|
|
|
i = i + 1
|
|
i = i + 1
|
|
|
|
|
+ v = v + 1
|
|
|
else:
|
|
else:
|
|
|
- curs.execute("delete from back where title = '" + pymysql.escape_string(rows[i]['link']) + "' and link = '" + pymysql.escape_string(name) + "'")
|
|
|
|
|
|
|
+ curs.execute("delete from back where title = '" + pymysql.escape_string(name) + "' and link = '" + pymysql.escape_string(rows[i]['link']) + "'")
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
i = i + 1
|
|
i = i + 1
|
|
|
v = v + 1
|
|
v = v + 1
|
|
|
else:
|
|
else:
|
|
|
- curs.execute("delete from back where title = '" + pymysql.escape_string(rows[i]['link']) + "' and link = '" + pymysql.escape_string(name) + "'")
|
|
|
|
|
|
|
+ curs.execute("delete from back where title = '" + pymysql.escape_string(name) + "' and link = '" + pymysql.escape_string(rows[i]['link']) + "'")
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
i = i + 1
|
|
i = i + 1
|
|
|
v = v + 1
|
|
v = v + 1
|
|
@@ -2431,21 +2437,27 @@ def topic(name = None):
|
|
|
except:
|
|
except:
|
|
|
div = div + '</div>'
|
|
div = div + '</div>'
|
|
|
break
|
|
break
|
|
|
|
|
+
|
|
|
curs.execute("select * from topic where title = '" + pymysql.escape_string(rows[i]['title']) + "' and sub = '" + pymysql.escape_string(rows[i]['sub']) + "' and id = '1' order by sub asc")
|
|
curs.execute("select * from topic where title = '" + pymysql.escape_string(rows[i]['title']) + "' and sub = '" + pymysql.escape_string(rows[i]['sub']) + "' and id = '1' order by sub asc")
|
|
|
aa = curs.fetchall()
|
|
aa = curs.fetchall()
|
|
|
|
|
+
|
|
|
indata = namumark(name, aa[0]['data'])
|
|
indata = namumark(name, aa[0]['data'])
|
|
|
|
|
+
|
|
|
if(aa[0]['block'] == 'O'):
|
|
if(aa[0]['block'] == 'O'):
|
|
|
indata = '블라인드 되었습니다.'
|
|
indata = '블라인드 되었습니다.'
|
|
|
block = 'style="background: gainsboro;"'
|
|
block = 'style="background: gainsboro;"'
|
|
|
else:
|
|
else:
|
|
|
block = ''
|
|
block = ''
|
|
|
|
|
+
|
|
|
curs.execute("select * from stop where title = '" + pymysql.escape_string(rows[i]['title']) + "' and sub = '" + pymysql.escape_string(rows[i]['sub']) + "' and close = 'O'")
|
|
curs.execute("select * from stop where title = '" + pymysql.escape_string(rows[i]['title']) + "' and sub = '" + pymysql.escape_string(rows[i]['sub']) + "' and close = 'O'")
|
|
|
row = curs.fetchall()
|
|
row = curs.fetchall()
|
|
|
if(not row):
|
|
if(not row):
|
|
|
div = div + '<h2><a href="/topic/' + parse.quote(rows[i]['title']).replace('/','%2F') + '/sub/' + parse.quote(rows[i]['sub']).replace('/','%2F') + '">' + str(j) + '. ' + rows[i]['sub'] + '</a></h2>'
|
|
div = div + '<h2><a href="/topic/' + parse.quote(rows[i]['title']).replace('/','%2F') + '/sub/' + parse.quote(rows[i]['sub']).replace('/','%2F') + '">' + str(j) + '. ' + rows[i]['sub'] + '</a></h2>'
|
|
|
div = div + '<table id="toron"><tbody><tr><td id="toroncolorgreen"><a href="javascript:void(0);" id="1">#1</a> ' + aa[0]['ip'] + ' <span style="float:right;">' + aa[0]['date'] + '</span></td></tr><tr><td ' + block + '>' + indata + '</td></tr></tbody></table><br>'
|
|
div = div + '<table id="toron"><tbody><tr><td id="toroncolorgreen"><a href="javascript:void(0);" id="1">#1</a> ' + aa[0]['ip'] + ' <span style="float:right;">' + aa[0]['date'] + '</span></td></tr><tr><td ' + block + '>' + indata + '</td></tr></tbody></table><br>'
|
|
|
j = j + 1
|
|
j = j + 1
|
|
|
|
|
+
|
|
|
i = i + 1
|
|
i = i + 1
|
|
|
|
|
+
|
|
|
return render_template('index.html', title = name, page = parse.quote(name).replace('/','%2F'), logo = data['name'], plus = div, tn = 10, list = 1)
|
|
return render_template('index.html', title = name, page = parse.quote(name).replace('/','%2F'), logo = data['name'], plus = div, tn = 10, list = 1)
|
|
|
|
|
|
|
|
@app.route('/topic/<path:name>/close')
|
|
@app.route('/topic/<path:name>/close')
|
|
@@ -2455,6 +2467,7 @@ def topicstoplist(name = None):
|
|
|
else:
|
|
else:
|
|
|
div = '<div>'
|
|
div = '<div>'
|
|
|
i = 0
|
|
i = 0
|
|
|
|
|
+
|
|
|
curs.execute("select * from stop where title = '" + pymysql.escape_string(name) + "' and close = 'O' order by sub asc")
|
|
curs.execute("select * from stop where title = '" + pymysql.escape_string(name) + "' and close = 'O' order by sub asc")
|
|
|
rows = curs.fetchall()
|
|
rows = curs.fetchall()
|
|
|
while True:
|
|
while True:
|
|
@@ -2463,19 +2476,24 @@ def topicstoplist(name = None):
|
|
|
except:
|
|
except:
|
|
|
div = div + '</div>'
|
|
div = div + '</div>'
|
|
|
break
|
|
break
|
|
|
|
|
+
|
|
|
curs.execute("select * from topic where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(rows[i]['sub']) + "' and id = '1'")
|
|
curs.execute("select * from topic where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(rows[i]['sub']) + "' and id = '1'")
|
|
|
row = curs.fetchall()
|
|
row = curs.fetchall()
|
|
|
if(row):
|
|
if(row):
|
|
|
j = i + 1
|
|
j = i + 1
|
|
|
indata = namumark(name, row[0]['data'])
|
|
indata = namumark(name, row[0]['data'])
|
|
|
|
|
+
|
|
|
if(row[0]['block'] == 'O'):
|
|
if(row[0]['block'] == 'O'):
|
|
|
indata = '블라인드 되었습니다.'
|
|
indata = '블라인드 되었습니다.'
|
|
|
block = 'style="background: gainsboro;"'
|
|
block = 'style="background: gainsboro;"'
|
|
|
else:
|
|
else:
|
|
|
block = ''
|
|
block = ''
|
|
|
|
|
+
|
|
|
div = div + '<h2><a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(rows[i]['sub']).replace('/','%2F') + '">' + str((i + 1)) + '. ' + rows[i]['sub'] + '</a></h2>'
|
|
div = div + '<h2><a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(rows[i]['sub']).replace('/','%2F') + '">' + str((i + 1)) + '. ' + rows[i]['sub'] + '</a></h2>'
|
|
|
div = div + '<table id="toron"><tbody><tr><td id="toroncolorgreen"><a href="javascript:void(0);" id="' + str(j) + '">#' + str(j) + '</a> ' + row[0]['ip'] + ' <span style="float:right;">' + row[0]['date'] + '</span></td></tr><tr><td ' + block + '>' + indata + '</td></tr></tbody></table><br>'
|
|
div = div + '<table id="toron"><tbody><tr><td id="toroncolorgreen"><a href="javascript:void(0);" id="' + str(j) + '">#' + str(j) + '</a> ' + row[0]['ip'] + ' <span style="float:right;">' + row[0]['date'] + '</span></td></tr><tr><td ' + block + '>' + indata + '</td></tr></tbody></table><br>'
|
|
|
|
|
+
|
|
|
i = i + 1
|
|
i = i + 1
|
|
|
|
|
+
|
|
|
return render_template('index.html', title = name, page = parse.quote(name).replace('/','%2F'), logo = data['name'], plus = div, tn = 10)
|
|
return render_template('index.html', title = name, page = parse.quote(name).replace('/','%2F'), logo = data['name'], plus = div, tn = 10)
|
|
|
|
|
|
|
|
@app.route('/topic/<path:name>/sub/<path:sub>', methods=['POST', 'GET'])
|
|
@app.route('/topic/<path:name>/sub/<path:sub>', methods=['POST', 'GET'])
|
|
@@ -2487,8 +2505,10 @@ def sub(name = None, sub = None):
|
|
|
number = int(rows[0]['id']) + 1
|
|
number = int(rows[0]['id']) + 1
|
|
|
else:
|
|
else:
|
|
|
number = 1
|
|
number = 1
|
|
|
|
|
+
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
ban = getdiscuss(ip, name, sub)
|
|
ban = getdiscuss(ip, name, sub)
|
|
|
|
|
+
|
|
|
if(ban == 1):
|
|
if(ban == 1):
|
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
|
else:
|
|
else:
|
|
@@ -2497,39 +2517,51 @@ def sub(name = None, sub = None):
|
|
|
if(rows):
|
|
if(rows):
|
|
|
if(rows[0]['acl'] == 'owner' or rows[0]['acl'] == 'admin'):
|
|
if(rows[0]['acl'] == 'owner' or rows[0]['acl'] == 'admin'):
|
|
|
ip = ip + ' - Admin'
|
|
ip = ip + ' - Admin'
|
|
|
|
|
+
|
|
|
today = getnow()
|
|
today = getnow()
|
|
|
discuss(name, sub, today)
|
|
discuss(name, sub, today)
|
|
|
|
|
+
|
|
|
aa = request.form["content"]
|
|
aa = request.form["content"]
|
|
|
aa = re.sub("\[\[(분류:(?:(?:(?!\]\]).)*))\]\]", "[br]", aa)
|
|
aa = re.sub("\[\[(분류:(?:(?:(?!\]\]).)*))\]\]", "[br]", aa)
|
|
|
aa = re.sub("\[date\(now\)\]", today, aa)
|
|
aa = re.sub("\[date\(now\)\]", today, aa)
|
|
|
|
|
+
|
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block) value ('" + str(number) + "', '" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', '" + pymysql.escape_string(aa) + "', '" + today + "', '" + ip + "', '')")
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block) value ('" + str(number) + "', '" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', '" + pymysql.escape_string(aa) + "', '" + today + "', '" + ip + "', '')")
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
|
|
+
|
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '" />'
|
|
|
else:
|
|
else:
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
ban = getdiscuss(ip, name, sub)
|
|
ban = getdiscuss(ip, name, sub)
|
|
|
admin = admincheck()
|
|
admin = admincheck()
|
|
|
|
|
+
|
|
|
if(admin == 1):
|
|
if(admin == 1):
|
|
|
div = '<div>' + '<a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '/close">(토론 닫기 및 열기)</a>' + ' <a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '/stop">(토론 정지 및 재개)</a><br><br>'
|
|
div = '<div>' + '<a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '/close">(토론 닫기 및 열기)</a>' + ' <a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '/stop">(토론 정지 및 재개)</a><br><br>'
|
|
|
else:
|
|
else:
|
|
|
div = '<div>'
|
|
div = '<div>'
|
|
|
|
|
+
|
|
|
i = 0
|
|
i = 0
|
|
|
|
|
+
|
|
|
curs.execute("select * from topic where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(sub) + "' order by id+0 asc")
|
|
curs.execute("select * from topic where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(sub) + "' order by id+0 asc")
|
|
|
rows = curs.fetchall()
|
|
rows = curs.fetchall()
|
|
|
|
|
+
|
|
|
while True:
|
|
while True:
|
|
|
try:
|
|
try:
|
|
|
a = rows[i]
|
|
a = rows[i]
|
|
|
except:
|
|
except:
|
|
|
div = div + '</div>'
|
|
div = div + '</div>'
|
|
|
break
|
|
break
|
|
|
|
|
+
|
|
|
if(i == 0):
|
|
if(i == 0):
|
|
|
start = rows[i]['ip']
|
|
start = rows[i]['ip']
|
|
|
|
|
+
|
|
|
indata = namumark(name, rows[i]['data'])
|
|
indata = namumark(name, rows[i]['data'])
|
|
|
|
|
+
|
|
|
if(rows[i]['block'] == 'O'):
|
|
if(rows[i]['block'] == 'O'):
|
|
|
indata = '블라인드 되었습니다.'
|
|
indata = '블라인드 되었습니다.'
|
|
|
block = 'style="background: gainsboro;"'
|
|
block = 'style="background: gainsboro;"'
|
|
|
else:
|
|
else:
|
|
|
block = ''
|
|
block = ''
|
|
|
|
|
+
|
|
|
m = re.search("([^-]*)\s\-\s(Close|Reopen|Stop|Restart)$", rows[i]['ip'])
|
|
m = re.search("([^-]*)\s\-\s(Close|Reopen|Stop|Restart)$", rows[i]['ip'])
|
|
|
if(m):
|
|
if(m):
|
|
|
ban = ""
|
|
ban = ""
|
|
@@ -2541,6 +2573,7 @@ def sub(name = None, sub = None):
|
|
|
isblock = ' <a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '/b/' + str(i + 1) + '">(해제)</a>'
|
|
isblock = ' <a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '/b/' + str(i + 1) + '">(해제)</a>'
|
|
|
else:
|
|
else:
|
|
|
isblock = ' <a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '/b/' + str(i + 1) + '">(블라인드)</a>'
|
|
isblock = ' <a href="/topic/' + parse.quote(name).replace('/','%2F') + '/sub/' + parse.quote(sub).replace('/','%2F') + '/b/' + str(i + 1) + '">(블라인드)</a>'
|
|
|
|
|
+
|
|
|
n = re.search("\- (?:Admin)$", rows[i]['ip'])
|
|
n = re.search("\- (?:Admin)$", rows[i]['ip'])
|
|
|
if(n):
|
|
if(n):
|
|
|
ban = isblock
|
|
ban = isblock
|
|
@@ -2551,6 +2584,7 @@ def sub(name = None, sub = None):
|
|
|
ban = ' <a href="/ban/' + parse.quote(rows[i]['ip']).replace('/','%2F') + '">(차단)</a>' + isblock
|
|
ban = ' <a href="/ban/' + parse.quote(rows[i]['ip']).replace('/','%2F') + '">(차단)</a>' + isblock
|
|
|
else:
|
|
else:
|
|
|
ban = ""
|
|
ban = ""
|
|
|
|
|
+
|
|
|
m = re.search("([^-]*)\s\-\s(Close|Reopen|Stop|Restart|Admin)$", rows[i]['ip'])
|
|
m = re.search("([^-]*)\s\-\s(Close|Reopen|Stop|Restart|Admin)$", rows[i]['ip'])
|
|
|
if(m):
|
|
if(m):
|
|
|
g = m.groups()
|
|
g = m.groups()
|
|
@@ -2569,19 +2603,23 @@ def sub(name = None, sub = None):
|
|
|
ip = '<a href="/w/' + parse.quote('사용자:' + rows[i]['ip']).replace('/','%2F') + '">' + rows[i]['ip'] + '</a>'
|
|
ip = '<a href="/w/' + parse.quote('사용자:' + rows[i]['ip']).replace('/','%2F') + '">' + rows[i]['ip'] + '</a>'
|
|
|
else:
|
|
else:
|
|
|
ip = '<a class="not_thing" href="/w/' + parse.quote('사용자:' + rows[i]['ip']).replace('/','%2F') + '">' + rows[i]['ip'] + '</a>'
|
|
ip = '<a class="not_thing" href="/w/' + parse.quote('사용자:' + rows[i]['ip']).replace('/','%2F') + '">' + rows[i]['ip'] + '</a>'
|
|
|
|
|
+
|
|
|
if(rows[i]['ip'] == start):
|
|
if(rows[i]['ip'] == start):
|
|
|
j = i + 1
|
|
j = i + 1
|
|
|
div = div + '<table id="toron"><tbody><tr><td id="toroncolorgreen"><a href="javascript:void(0);" id="' + str(j) + '">#' + str(j) + '</a> ' + ip + ban + ' <span style="float:right;">' + rows[i]['date'] + '</span></td></tr><tr><td ' + block + '>' + indata + '</td></tr></tbody></table><br>'
|
|
div = div + '<table id="toron"><tbody><tr><td id="toroncolorgreen"><a href="javascript:void(0);" id="' + str(j) + '">#' + str(j) + '</a> ' + ip + ban + ' <span style="float:right;">' + rows[i]['date'] + '</span></td></tr><tr><td ' + block + '>' + indata + '</td></tr></tbody></table><br>'
|
|
|
else:
|
|
else:
|
|
|
j = i + 1
|
|
j = i + 1
|
|
|
div = div + '<table id="toron"><tbody><tr><td id="toroncolor"><a href="javascript:void(0);" id="' + str(j) + '">#' + str(j) + '</a> ' + ip + ban + ' <span style="float:right;">' + rows[i]['date'] + '</span></td></tr><tr><td ' + block + '>' + indata + '</td></tr></tbody></table><br>'
|
|
div = div + '<table id="toron"><tbody><tr><td id="toroncolor"><a href="javascript:void(0);" id="' + str(j) + '">#' + str(j) + '</a> ' + ip + ban + ' <span style="float:right;">' + rows[i]['date'] + '</span></td></tr><tr><td ' + block + '>' + indata + '</td></tr></tbody></table><br>'
|
|
|
|
|
+
|
|
|
i = i + 1
|
|
i = i + 1
|
|
|
|
|
+
|
|
|
return render_template('index.html', title = name, page = parse.quote(name).replace('/','%2F'), suburl = parse.quote(sub).replace('/','%2F'), sub = sub, logo = data['name'], rows = div, tn = 11, ban = ban)
|
|
return render_template('index.html', title = name, page = parse.quote(name).replace('/','%2F'), suburl = parse.quote(sub).replace('/','%2F'), sub = sub, logo = data['name'], rows = div, tn = 11, ban = ban)
|
|
|
|
|
|
|
|
@app.route('/topic/<path:name>/sub/<path:sub>/b/<number>')
|
|
@app.route('/topic/<path:name>/sub/<path:sub>/b/<number>')
|
|
|
def blind(name = None, sub = None, number = None):
|
|
def blind(name = None, sub = None, number = None):
|
|
|
if(session.get('Now') == True):
|
|
if(session.get('Now') == True):
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
|
|
+
|
|
|
curs.execute("select * from user where id = '" + pymysql.escape_string(ip) + "'")
|
|
curs.execute("select * from user where id = '" + pymysql.escape_string(ip) + "'")
|
|
|
rows = curs.fetchall()
|
|
rows = curs.fetchall()
|
|
|
if(rows):
|
|
if(rows):
|
|
@@ -2594,6 +2632,7 @@ def blind(name = None, sub = None, number = None):
|
|
|
else:
|
|
else:
|
|
|
curs.execute("update topic set block = 'O' where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(sub) + "' and id = '" + number + "'")
|
|
curs.execute("update topic set block = 'O' where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(sub) + "' and id = '" + number + "'")
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
|
|
+
|
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
|
else:
|
|
else:
|
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
@@ -2608,6 +2647,7 @@ def blind(name = None, sub = None, number = None):
|
|
|
def topicstop(name = None, sub = None):
|
|
def topicstop(name = None, sub = None):
|
|
|
if(session.get('Now') == True):
|
|
if(session.get('Now') == True):
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
|
|
+
|
|
|
curs.execute("select * from user where id = '" + pymysql.escape_string(ip) + "'")
|
|
curs.execute("select * from user where id = '" + pymysql.escape_string(ip) + "'")
|
|
|
rows = curs.fetchall()
|
|
rows = curs.fetchall()
|
|
|
if(rows):
|
|
if(rows):
|
|
@@ -2616,6 +2656,7 @@ def topicstop(name = None, sub = None):
|
|
|
row = curs.fetchall()
|
|
row = curs.fetchall()
|
|
|
if(row):
|
|
if(row):
|
|
|
today = getnow()
|
|
today = getnow()
|
|
|
|
|
+
|
|
|
curs.execute("select * from stop where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(sub) + "' and close = ''")
|
|
curs.execute("select * from stop where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(sub) + "' and close = ''")
|
|
|
rows = curs.fetchall()
|
|
rows = curs.fetchall()
|
|
|
if(rows):
|
|
if(rows):
|
|
@@ -2625,6 +2666,7 @@ def topicstop(name = None, sub = None):
|
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block) value ('" + pymysql.escape_string(str(int(row[0]['id']) + 1)) + "', '" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', 'Stop', '" + pymysql.escape_string(today) + "', '" + pymysql.escape_string(ip) + " - Stop', '')")
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block) value ('" + pymysql.escape_string(str(int(row[0]['id']) + 1)) + "', '" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', 'Stop', '" + pymysql.escape_string(today) + "', '" + pymysql.escape_string(ip) + " - Stop', '')")
|
|
|
curs.execute("insert into stop (title, sub, close) value ('" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', '')")
|
|
curs.execute("insert into stop (title, sub, close) value ('" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', '')")
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
|
|
+
|
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
|
else:
|
|
else:
|
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
@@ -2639,6 +2681,7 @@ def topicstop(name = None, sub = None):
|
|
|
def topicclose(name = None, sub = None):
|
|
def topicclose(name = None, sub = None):
|
|
|
if(session.get('Now') == True):
|
|
if(session.get('Now') == True):
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
|
|
+
|
|
|
curs.execute("select * from user where id = '" + pymysql.escape_string(ip) + "'")
|
|
curs.execute("select * from user where id = '" + pymysql.escape_string(ip) + "'")
|
|
|
rows = curs.fetchall()
|
|
rows = curs.fetchall()
|
|
|
if(rows):
|
|
if(rows):
|
|
@@ -2647,6 +2690,7 @@ def topicclose(name = None, sub = None):
|
|
|
row = curs.fetchall()
|
|
row = curs.fetchall()
|
|
|
if(row):
|
|
if(row):
|
|
|
today = getnow()
|
|
today = getnow()
|
|
|
|
|
+
|
|
|
curs.execute("select * from stop where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(sub) + "' and close = 'O'")
|
|
curs.execute("select * from stop where title = '" + pymysql.escape_string(name) + "' and sub = '" + pymysql.escape_string(sub) + "' and close = 'O'")
|
|
|
rows = curs.fetchall()
|
|
rows = curs.fetchall()
|
|
|
if(rows):
|
|
if(rows):
|
|
@@ -2656,6 +2700,7 @@ def topicclose(name = None, sub = None):
|
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block) value ('" + pymysql.escape_string(str(int(row[0]['id']) + 1)) + "', '" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', 'Close', '" + pymysql.escape_string(today) + "', '" + pymysql.escape_string(ip) + " - Close', '')")
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block) value ('" + pymysql.escape_string(str(int(row[0]['id']) + 1)) + "', '" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', 'Close', '" + pymysql.escape_string(today) + "', '" + pymysql.escape_string(ip) + " - Close', '')")
|
|
|
curs.execute("insert into stop (title, sub, close) value ('" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', 'O')")
|
|
curs.execute("insert into stop (title, sub, close) value ('" + pymysql.escape_string(name) + "', '" + pymysql.escape_string(sub) + "', 'O')")
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
|
|
+
|
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
|
else:
|
|
else:
|
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/topic/' + name + '/sub/' + sub + '" />'
|
|
@@ -2671,6 +2716,7 @@ def login():
|
|
|
if(request.method == 'POST'):
|
|
if(request.method == 'POST'):
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
ban = getban(ip)
|
|
ban = getban(ip)
|
|
|
|
|
+
|
|
|
if(ban == 1):
|
|
if(ban == 1):
|
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
|
else:
|
|
else:
|
|
@@ -2682,8 +2728,10 @@ def login():
|
|
|
elif(bcrypt.checkpw(bytes(request.form["pw"], 'utf-8'), bytes(rows[0]['pw'], 'utf-8'))):
|
|
elif(bcrypt.checkpw(bytes(request.form["pw"], 'utf-8'), bytes(rows[0]['pw'], 'utf-8'))):
|
|
|
session['Now'] = True
|
|
session['Now'] = True
|
|
|
session['DREAMER'] = request.form["id"]
|
|
session['DREAMER'] = request.form["id"]
|
|
|
|
|
+
|
|
|
curs.execute("insert into login (user, ip, today) value ('" + pymysql.escape_string(request.form["id"]) + "', '" + pymysql.escape_string(ip) + "', '" + pymysql.escape_string(getnow()) + "')")
|
|
curs.execute("insert into login (user, ip, today) value ('" + pymysql.escape_string(request.form["id"]) + "', '" + pymysql.escape_string(ip) + "', '" + pymysql.escape_string(getnow()) + "')")
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
|
|
+
|
|
|
return '<meta http-equiv="refresh" content="0;url=/w/' + parse.quote(data['frontpage']).replace('/','%2F') + '" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/w/' + parse.quote(data['frontpage']).replace('/','%2F') + '" />'
|
|
|
else:
|
|
else:
|
|
|
return '<meta http-equiv="refresh" content="0;url=/error/13" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/error/13" />'
|
|
@@ -2692,6 +2740,7 @@ def login():
|
|
|
else:
|
|
else:
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
ban = getban(ip)
|
|
ban = getban(ip)
|
|
|
|
|
+
|
|
|
if(ban == 1):
|
|
if(ban == 1):
|
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
|
else:
|
|
else:
|
|
@@ -2705,6 +2754,7 @@ def change():
|
|
|
if(request.method == 'POST'):
|
|
if(request.method == 'POST'):
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
ban = getban(ip)
|
|
ban = getban(ip)
|
|
|
|
|
+
|
|
|
if(ban == 1):
|
|
if(ban == 1):
|
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
|
else:
|
|
else:
|
|
@@ -2715,8 +2765,10 @@ def change():
|
|
|
return '<meta http-equiv="refresh" content="0;url=/logout" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/logout" />'
|
|
|
elif(bcrypt.checkpw(bytes(request.form["pw"], 'utf-8'), bytes(rows[0]['pw'], 'utf-8'))):
|
|
elif(bcrypt.checkpw(bytes(request.form["pw"], 'utf-8'), bytes(rows[0]['pw'], 'utf-8'))):
|
|
|
hashed = bcrypt.hashpw(bytes(request.form["pw2"], 'utf-8'), bcrypt.gensalt())
|
|
hashed = bcrypt.hashpw(bytes(request.form["pw2"], 'utf-8'), bcrypt.gensalt())
|
|
|
|
|
+
|
|
|
curs.execute("update user set pw = '" + pymysql.escape_string(hashed.decode()) + "' where id = '" + pymysql.escape_string(request.form["id"]) + "'")
|
|
curs.execute("update user set pw = '" + pymysql.escape_string(hashed.decode()) + "' where id = '" + pymysql.escape_string(request.form["id"]) + "'")
|
|
|
conn.commit()
|
|
conn.commit()
|
|
|
|
|
+
|
|
|
return '<meta http-equiv="refresh" content="0;url=/login" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/login" />'
|
|
|
else:
|
|
else:
|
|
|
return '<meta http-equiv="refresh" content="0;url=/error/10" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/error/10" />'
|
|
@@ -2725,6 +2777,7 @@ def change():
|
|
|
else:
|
|
else:
|
|
|
ip = getip(request)
|
|
ip = getip(request)
|
|
|
ban = getban(ip)
|
|
ban = getban(ip)
|
|
|
|
|
+
|
|
|
if(ban == 1):
|
|
if(ban == 1):
|
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
return '<meta http-equiv="refresh" content="0;url=/ban" />'
|
|
|
else:
|
|
else:
|