|
@@ -15,7 +15,7 @@ import random
|
|
|
|
|
|
|
|
from func import *
|
|
from func import *
|
|
|
|
|
|
|
|
-r_ver = 'v3.0.8-master-06'
|
|
|
|
|
|
|
+r_ver = 'v3.0.8-master-07'
|
|
|
c_ver = ''.join(re.findall('[0-9]', r_ver))
|
|
c_ver = ''.join(re.findall('[0-9]', r_ver))
|
|
|
|
|
|
|
|
print('version : ' + r_ver)
|
|
print('version : ' + r_ver)
|
|
@@ -134,7 +134,7 @@ if setup_tool != 0:
|
|
|
create_data['data'] = ['title', 'data']
|
|
create_data['data'] = ['title', 'data']
|
|
|
create_data['cache_data'] = ['title', 'data']
|
|
create_data['cache_data'] = ['title', 'data']
|
|
|
create_data['history'] = ['id', 'title', 'data', 'date', 'ip', 'send', 'leng', 'hide', 'type']
|
|
create_data['history'] = ['id', 'title', 'data', 'date', 'ip', 'send', 'leng', 'hide', 'type']
|
|
|
- create_data['rd'] = ['title', 'sub', 'date', 'band']
|
|
|
|
|
|
|
+ create_data['rd'] = ['title', 'sub', 'date', 'band', 'stop']
|
|
|
create_data['user'] = ['id', 'pw', 'acl', 'date', 'encode']
|
|
create_data['user'] = ['id', 'pw', 'acl', 'date', 'encode']
|
|
|
create_data['user_set'] = ['name', 'id', 'data']
|
|
create_data['user_set'] = ['name', 'id', 'data']
|
|
|
create_data['ban'] = ['block', 'end', 'why', 'band', 'login']
|
|
create_data['ban'] = ['block', 'end', 'why', 'band', 'login']
|
|
@@ -877,7 +877,7 @@ def not_close_topic():
|
|
|
curs.execute('select title, sub from rd order by date desc')
|
|
curs.execute('select title, sub from rd order by date desc')
|
|
|
n_list = curs.fetchall()
|
|
n_list = curs.fetchall()
|
|
|
for data in n_list:
|
|
for data in n_list:
|
|
|
- curs.execute('select * from stop where title = ? and sub = ? and close = "O"', [data[0], data[1]])
|
|
|
|
|
|
|
+ curs.execute('select * from rd where title = ? and sub = ? and close = "O"', [data[0], data[1]])
|
|
|
is_close = curs.fetchall()
|
|
is_close = curs.fetchall()
|
|
|
if not is_close:
|
|
if not is_close:
|
|
|
div += '<li><a href="/topic/' + url_pas(data[0]) + '/sub/' + url_pas(data[1]) + '">' + data[0] + ' (' + data[1] + ')</a></li>'
|
|
div += '<li><a href="/topic/' + url_pas(data[0]) + '/sub/' + url_pas(data[1]) + '">' + data[0] + ' (' + data[1] + ')</a></li>'
|
|
@@ -1325,26 +1325,18 @@ def recent_discuss():
|
|
|
</tr>
|
|
</tr>
|
|
|
'''
|
|
'''
|
|
|
|
|
|
|
|
- curs.execute("select title, sub, date from rd order by date desc limit 50")
|
|
|
|
|
|
|
+ if m_sub == 0:
|
|
|
|
|
+ curs.execute("select title, sub, date from rd where not stop = 'O' order by date desc limit 50")
|
|
|
|
|
+ else:
|
|
|
|
|
+ curs.execute("select title, sub, date from rd where stop = 'O' order by date desc limit 50")
|
|
|
|
|
+
|
|
|
for data in curs.fetchall():
|
|
for data in curs.fetchall():
|
|
|
title = html.escape(data[0])
|
|
title = html.escape(data[0])
|
|
|
sub = html.escape(data[1])
|
|
sub = html.escape(data[1])
|
|
|
-
|
|
|
|
|
- close = 0
|
|
|
|
|
-
|
|
|
|
|
- if flask.request.args.get('what', 'normal') == 'normal':
|
|
|
|
|
- curs.execute("select title from stop where title = ? and sub = ? and close = 'O'", [data[0], data[1]])
|
|
|
|
|
- if curs.fetchall():
|
|
|
|
|
- close = 1
|
|
|
|
|
- else:
|
|
|
|
|
- curs.execute("select title from stop where title = ? and sub = ? and close = 'O'", [data[0], data[1]])
|
|
|
|
|
- if not curs.fetchall():
|
|
|
|
|
- close = 1
|
|
|
|
|
|
|
|
|
|
- if close == 0:
|
|
|
|
|
- div += '<tr><td><a href="/topic/' + url_pas(data[0]) + '/sub/' + url_pas(data[1]) + '">' + title + '</a> (' + sub + ')</td><td>' + data[2] + '</td></tr>'
|
|
|
|
|
- else:
|
|
|
|
|
- div += '</tbody></table>'
|
|
|
|
|
|
|
+ div += '<tr><td><a href="/topic/' + url_pas(data[0]) + '/sub/' + url_pas(data[1]) + '">' + title + '</a> (' + sub + ')</td><td>' + data[2] + '</td></tr>'
|
|
|
|
|
+
|
|
|
|
|
+ div += '</tbody></table>'
|
|
|
|
|
|
|
|
return easy_minify(flask.render_template(skin_check(),
|
|
return easy_minify(flask.render_template(skin_check(),
|
|
|
imp = [load_lang('recent') + ' ' + load_lang('discussion'), wiki_set(), custom(), other2([m_sub, 0])],
|
|
imp = [load_lang('recent') + ' ' + load_lang('discussion'), wiki_set(), custom(), other2([m_sub, 0])],
|
|
@@ -2221,7 +2213,7 @@ def topic_stop(name = None, sub = None, tool = None):
|
|
|
if tool == 'close':
|
|
if tool == 'close':
|
|
|
set_list = [
|
|
set_list = [
|
|
|
'O',
|
|
'O',
|
|
|
- '',
|
|
|
|
|
|
|
+ 'S',
|
|
|
load_lang('discussion', 1) + ' ' + load_lang('close', 1),
|
|
load_lang('discussion', 1) + ' ' + load_lang('close', 1),
|
|
|
load_lang('discussion', 1) + ' ' + load_lang('open', 1)
|
|
load_lang('discussion', 1) + ' ' + load_lang('open', 1)
|
|
|
]
|
|
]
|
|
@@ -2255,14 +2247,13 @@ def topic_stop(name = None, sub = None, tool = None):
|
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, '" + load_lang('agreement', 1) + " O', ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, time, ip])
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, '" + load_lang('agreement', 1) + " O', ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, time, ip])
|
|
|
curs.execute("insert into agreedis (title, sub) values (?, ?)", [name, sub])
|
|
curs.execute("insert into agreedis (title, sub) values (?, ?)", [name, sub])
|
|
|
else:
|
|
else:
|
|
|
- curs.execute("select title from stop where title = ? and sub = ? and close = ?", [name, sub, set_list[0]])
|
|
|
|
|
|
|
+ curs.execute("select title from rd where title = ? and sub = ? and stop = ?", [name, sub, set_list[0]])
|
|
|
if curs.fetchall():
|
|
if curs.fetchall():
|
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, set_list[3], time, ip])
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, set_list[3], time, ip])
|
|
|
- curs.execute("delete from stop where title = ? and sub = ? and close = ?", [name, sub, set_list[0]])
|
|
|
|
|
|
|
+ curs.execute("update rd set stop = '' where title = ? and sub = ?", [name, sub])
|
|
|
else:
|
|
else:
|
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, set_list[2], time, ip])
|
|
curs.execute("insert into topic (id, title, sub, data, date, ip, block, top) values (?, ?, ?, ?, ?, ?, '', '1')", [str(int(topic_check[0][0]) + 1), name, sub, set_list[2], time, ip])
|
|
|
- curs.execute("insert into stop (title, sub, close) values (?, ?, ?)", [name, sub, set_list[0]])
|
|
|
|
|
- curs.execute("delete from stop where title = ? and sub = ? and close = ?", [name, sub, set_list[1]])
|
|
|
|
|
|
|
+ curs.execute("update rd set stop = ? where title = ? and sub = ?", [set_list[0], name, sub])
|
|
|
|
|
|
|
|
rd_plus(name, sub, time)
|
|
rd_plus(name, sub, time)
|
|
|
|
|
|
|
@@ -2371,10 +2362,10 @@ def topic(name = None, sub = None):
|
|
|
|
|
|
|
|
return redirect('/topic/' + url_pas(name) + '/sub/' + url_pas(sub) + '#reload')
|
|
return redirect('/topic/' + url_pas(name) + '/sub/' + url_pas(sub) + '#reload')
|
|
|
else:
|
|
else:
|
|
|
- curs.execute("select title from stop where title = ? and sub = ? and close = 'O'", [name, sub])
|
|
|
|
|
|
|
+ curs.execute("select title from rd where title = ? and sub = ? and stop = 'O'", [name, sub])
|
|
|
close_data = curs.fetchall()
|
|
close_data = curs.fetchall()
|
|
|
|
|
|
|
|
- curs.execute("select title from stop where title = ? and sub = ? and close = ''", [name, sub])
|
|
|
|
|
|
|
+ curs.execute("select title from rd where title = ? and sub = ? and stop = 'S'", [name, sub])
|
|
|
stop_data = curs.fetchall()
|
|
stop_data = curs.fetchall()
|
|
|
|
|
|
|
|
curs.execute("select id from topic where title = ? and sub = ? limit 1", [name, sub])
|
|
curs.execute("select id from topic where title = ? and sub = ? limit 1", [name, sub])
|
|
@@ -2546,7 +2537,7 @@ def close_topic_list(name = None, tool = None):
|
|
|
menu = [['topic/' + url_pas(name), load_lang('list')]]
|
|
menu = [['topic/' + url_pas(name), load_lang('list')]]
|
|
|
|
|
|
|
|
if tool == 'close':
|
|
if tool == 'close':
|
|
|
- curs.execute("select sub from stop where title = ? and close = 'O' order by sub asc", [name])
|
|
|
|
|
|
|
+ curs.execute("select sub from rd where title = ? and stop = 'O' order by sub asc", [name])
|
|
|
|
|
|
|
|
sub = load_lang('close') + ''
|
|
sub = load_lang('close') + ''
|
|
|
elif tool == 'agree':
|
|
elif tool == 'agree':
|
|
@@ -2574,7 +2565,7 @@ def close_topic_list(name = None, tool = None):
|
|
|
it_p = 0
|
|
it_p = 0
|
|
|
|
|
|
|
|
if sub == load_lang('discussion') + ' ' + load_lang('list'):
|
|
if sub == load_lang('discussion') + ' ' + load_lang('list'):
|
|
|
- curs.execute("select title from stop where title = ? and sub = ? and close = 'O' order by sub asc", [name, data[0]])
|
|
|
|
|
|
|
+ curs.execute("select title from rd where title = ? and sub = ? and stop = 'O' order by sub asc", [name, data[0]])
|
|
|
if curs.fetchall():
|
|
if curs.fetchall():
|
|
|
it_p = 1
|
|
it_p = 1
|
|
|
|
|
|
|
@@ -3382,14 +3373,9 @@ def read_view(name = None):
|
|
|
if redirect_data:
|
|
if redirect_data:
|
|
|
return redirect('/w/' + redirect_data[0][0] + '?from=' + name)
|
|
return redirect('/w/' + redirect_data[0][0] + '?from=' + name)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- curs.execute("select sub from rd where title = ? order by date desc", [name])
|
|
|
|
|
- for data in curs.fetchall():
|
|
|
|
|
- curs.execute("select title from stop where title = ? and sub = ? and close = 'O'", [name, data[0]])
|
|
|
|
|
- if not curs.fetchall():
|
|
|
|
|
- sub += ' (' + load_lang('discussion') + ')'
|
|
|
|
|
-
|
|
|
|
|
- break
|
|
|
|
|
|
|
+ curs.execute("select sub from rd where title = ? and not stop = 'O' order by date desc", [name])
|
|
|
|
|
+ if curs.fetchall():
|
|
|
|
|
+ sub += ' (' + load_lang('discussion') + ')'
|
|
|
|
|
|
|
|
curs.execute("select link from back where title = ? and type = 'cat' order by link asc", [name])
|
|
curs.execute("select link from back where title = ? and type = 'cat' order by link asc", [name])
|
|
|
|
|
|
|
@@ -4110,7 +4096,7 @@ def api_w(name = ''):
|
|
|
curs.execute("select data from data where title = ?", [name])
|
|
curs.execute("select data from data where title = ?", [name])
|
|
|
data = curs.fetchall()
|
|
data = curs.fetchall()
|
|
|
if data:
|
|
if data:
|
|
|
- json_data = { "title" : name, "data" : render_set(data = data[0][0]) }
|
|
|
|
|
|
|
+ json_data = { "title" : name, "data" : render_set(title = name, data = data[0][0]) }
|
|
|
|
|
|
|
|
return flask.jsonify(json_data)
|
|
return flask.jsonify(json_data)
|
|
|
else:
|
|
else:
|