Browse Source

이머전시 툴에 스킨도 추가

Surplus_Up (2DU) 7 năm trước cách đây
mục cha
commit
e43fdbf06a
2 tập tin đã thay đổi với 16 bổ sung15 xóa
  1. 6 0
      emergency_tool.py
  2. 10 15
      func.py

+ 6 - 0
emergency_tool.py

@@ -17,6 +17,7 @@ print('1. backlink reset')
 print('2. reCAPTCHA delete')
 print('3. ban delete')
 print('4. change port')
+print('5. change skin')
 
 print('select : ', end = '')
 what_i_do = input()
@@ -54,6 +55,11 @@ elif what_i_do == '4':
     port = input()
 
     curs.execute("update other set data = ? where name = 'port'", [port])
+elif what_i_do == '5':
+    print('skin name : ', end = '')
+    skin = input()
+
+    curs.execute("update other set data = ? where name = 'skin'", [skin])
 
 conn.commit()
 

+ 10 - 15
func.py

@@ -197,22 +197,17 @@ def ip_warring():
     return text_data
 
 def skin_check():
-    skin = './views/acme/'
+    curs.execute('select data from other where name = "skin"')
+    skin_exist = curs.fetchall()
+    if skin_exist and skin_exist[0][0] != '':
+        if os.path.exists(os.path.abspath('./views/' + skin_exist[0][0] + '/index.html')) == 1:
+            skin = './views/' + skin_exist[0][0] + '/'
     
-    try:
-        curs.execute('select data from user_set where name = "skin" and id = ?', [ip_check()])
-        skin_exist = curs.fetchall()
-        if skin_exist and skin_exist[0][0] != '':
-            if os.path.exists(os.path.abspath('./views/' + skin_exist[0][0] + '/index.html')) == 1:
-                skin = './views/' + skin_exist[0][0] + '/'
-        else:
-            curs.execute('select data from other where name = "skin"')
-            skin_exist = curs.fetchall()
-            if skin_exist:
-                if os.path.exists(os.path.abspath('./views/' + skin_exist[0][0] + '/index.html')) == 1:
-                    skin = './views/' + skin_exist[0][0] + '/'
-    except:
-        pass
+    curs.execute('select data from user_set where name = "skin" and id = ?', [ip_check()])
+    skin_exist = curs.fetchall()
+    if skin_exist and skin_exist[0][0] != '':
+        if os.path.exists(os.path.abspath('./views/' + skin_exist[0][0] + '/index.html')) == 1:
+            skin = './views/' + skin_exist[0][0] + '/'
 
     return skin + 'index.html'