Prechádzať zdrojové kódy

임시 수정 파일

잉여개발기 (SPDV) 5 rokov pred
rodič
commit
1aa62b910e
1 zmenil súbory, kde vykonal 25 pridanie a 4 odobranie
  1. 25 4
      route/tool/func.py

+ 25 - 4
route/tool/func.py

@@ -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])
         id_data = curs.fetchall()
         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 = send[:128] if len(send) > 128 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'"))
         if curs.fetchall()[0][0] >= 200:
             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][1]
                 ])
-        
+    
         curs.execute(db_change("insert into rc (id, title, date, type) values (?, ?, ?, 'normal')"), [
             id_data,
             title,
             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 (?, ?, ?, ?, ?, ?, ?, '', ?)"), [
         id_data,
         title,
@@ -1143,7 +1164,7 @@ def history_plus(title, data, date, ip, send, leng, t_check = '', d_type = '', m
         ip,
         send,
         leng,
-        d_type
+        mode
     ])
 
 def leng_check(first, second):