|
@@ -1113,12 +1113,15 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', d_type = '', m
|
|
|
curs.execute(db_change("select id from history where title = ? and type = '' order by id + 0 desc limit 1"), [title])
|
|
curs.execute(db_change("select id from history where title = ? and type = '' order by id + 0 desc limit 1"), [title])
|
|
|
id_data = curs.fetchall()
|
|
id_data = curs.fetchall()
|
|
|
id_data = str(int(id_data[0][0]) + 1) if id_data else '1'
|
|
id_data = str(int(id_data[0][0]) + 1) if id_data else '1'
|
|
|
|
|
+
|
|
|
|
|
+ mode = mode if mode != '' else 'edit'
|
|
|
|
|
+ mode = mode if not re.search('^user:', title) else 'user_page'
|
|
|
|
|
|
|
|
send = re.sub(r'\(|\)|<|>', '', send)
|
|
send = re.sub(r'\(|\)|<|>', '', send)
|
|
|
send = send[:128] if len(send) > 128 else send
|
|
send = send[:128] if len(send) > 128 else send
|
|
|
send = send + ' (' + t_check + ')' if t_check != '' else send
|
|
send = send + ' (' + t_check + ')' if t_check != '' else send
|
|
|
|
|
|
|
|
- if not re.search('^user:', title) and mode != 'add':
|
|
|
|
|
|
|
+ if mode != 'add' and mode != 'user_page':
|
|
|
curs.execute(db_change("select count(*) from rc where type = 'normal'"))
|
|
curs.execute(db_change("select count(*) from rc where type = 'normal'"))
|
|
|
if curs.fetchall()[0][0] >= 200:
|
|
if curs.fetchall()[0][0] >= 200:
|
|
|
curs.execute(db_change("select id, title from rc where type = 'normal' order by date asc limit 1"))
|
|
curs.execute(db_change("select id, title from rc where type = 'normal' order by date asc limit 1"))
|
|
@@ -1128,13 +1131,31 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', d_type = '', m
|
|
|
rc_data[0][0],
|
|
rc_data[0][0],
|
|
|
rc_data[0][1]
|
|
rc_data[0][1]
|
|
|
])
|
|
])
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"), [
|
|
curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"), [
|
|
|
id_data,
|
|
id_data,
|
|
|
title,
|
|
title,
|
|
|
date
|
|
date
|
|
|
])
|
|
])
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if mode != 'add':
|
|
|
|
|
+ curs.execute(db_change("select count(*) from rc where type = ?"), [mode])
|
|
|
|
|
+ if curs.fetchall()[0][0] >= 200:
|
|
|
|
|
+ curs.execute(db_change("select id, title from rc where type = ? order by date asc limit 1"), [mode])
|
|
|
|
|
+ rc_data = curs.fetchall()
|
|
|
|
|
+ if rc_data:
|
|
|
|
|
+ curs.execute(db_change('delete from rc where id = ? and title = ? and type = "normal"'), [
|
|
|
|
|
+ rc_data[0][0],
|
|
|
|
|
+ rc_data[0][1]
|
|
|
|
|
+ ])
|
|
|
|
|
+
|
|
|
|
|
+ curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, ?)"), [
|
|
|
|
|
+ id_data,
|
|
|
|
|
+ title,
|
|
|
|
|
+ date,
|
|
|
|
|
+ mode
|
|
|
|
|
+ ])
|
|
|
|
|
+
|
|
|
curs.execute(db_change("insert into history (id, title, data, date, ip, send, leng, hide, type) values (?, ?, ?, ?, ?, ?, ?, '', ?)"), [
|
|
curs.execute(db_change("insert into history (id, title, data, date, ip, send, leng, hide, type) values (?, ?, ?, ?, ?, ?, ?, '', ?)"), [
|
|
|
id_data,
|
|
id_data,
|
|
|
title,
|
|
title,
|
|
@@ -1143,7 +1164,7 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', d_type = '', m
|
|
|
ip,
|
|
ip,
|
|
|
send,
|
|
send,
|
|
|
leng,
|
|
leng,
|
|
|
- d_type
|
|
|
|
|
|
|
+ mode
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
def leng_check(first, second):
|
|
def leng_check(first, second):
|