Просмотр исходного кода

savemark 폐기, 이미지 문법에 따라서 다르게 저장

Surplus_Up (2DU) 6 лет назад
Родитель
Сommit
3f2f31380c

+ 0 - 2
route/edit.py

@@ -37,8 +37,6 @@ def edit_2(conn, name):
         copyright_checkbox_text_d = curs.fetchall()
         if copyright_checkbox_text_d and copyright_checkbox_text_d[0][0] != '' and flask.request.form.get('copyright_agreement', '') != 'yes':
             return re_error('/error/29')
-
-        content = savemark(content)
         
         if old:  
             o_data = old[0][0].replace('\r\n', '\n')

+ 0 - 2
route/edit_req.py

@@ -56,8 +56,6 @@ def edit_req_2(conn, name):
         if copyright_checkbox_text_d and copyright_checkbox_text_d[0][0] != '' and flask.request.form.get('copyright_agreement', '') != 'yes':
             return re_error('/error/29')
 
-        content = savemark(content)
-
         if old:
             leng = leng_check(len(flask.request.form.get('otent', '')), len(content))
 

+ 22 - 17
route/func_upload.py

@@ -57,30 +57,35 @@ def func_upload_2(conn):
                 if t_re.search(name):
                     return redirect('/file_filter')
 
-            ip = ip_check()
-
-            if flask.request.form.get('f_lice_sel', 'direct_input') == 'direct_input':
-                lice = flask.request.form.get('f_lice', '') + '[br][br]'
-                if ip_or_user(ip) != 0:
-                    lice += ip
-                else:
-                    lice += '[[user:' + ip + ']]'
-
-                lice += '[[category:direct_input]]'
-            else:
-                lice = flask.request.form.get('f_lice_sel', '')
-                lice += '[br][br]'  + flask.request.form.get('f_lice', '')
-                lice += '[[category:' + re.sub(r'\]', '_', flask.request.form.get('f_lice_sel', '')) + ']]'
-
             if os.path.exists(os.path.join(app_var['path_data_image'], e_data)):
-
                 os.remove(os.path.join(app_var['path_data_image'], e_data))
 
                 data.save(os.path.join(app_var['path_data_image'], e_data))
             else:
                 data.save(os.path.join(app_var['path_data_image'], e_data))
 
-            file_d = '[[file:' + name + ']][br][br]{{{[[file:' + name + ']]}}}[br][br]' + lice
+            ip = ip_check()
+            g_lice = g_lice
+
+            curs.execute(db_change("select data from other where name = 'markup'"))
+            db_data = curs.fetchall()
+            if db_data and db_data[0][0] == 'namumark':
+                if flask.request.form.get('f_lice_sel', 'direct_input') == 'direct_input':
+                    lice = g_lice + '[br][br]'
+                    if ip_or_user(ip) != 0:
+                        lice += ip
+                    else:
+                        lice += '[[user:' + ip + ']]'
+
+                    lice += '[[category:direct_input]]'
+                else:
+                    lice = flask.request.form.get('f_lice_sel', '')
+                    lice += '[br][br]'  + g_lice
+                    lice += '[[category:' + re.sub(r'\]', '_', flask.request.form.get('f_lice_sel', '')) + ']]'
+
+                file_d = '[[file:' + name + ']][br][br]{{{[[file:' + name + ']]}}}[br][br]' + lice
+            else:
+                file_d = name + ' | /image/' + e_data + ((' | ' + g_lice) if g_lice != '' else '') + ' | ' + ip
 
             curs.execute(db_change("insert into data (title, data) values (?, ?)"), ['file:' + name, file_d])
             curs.execute(db_change("insert into acl (title, decu, dis, why, view) values (?, 'admin', '', '', '')"), ['file:' + name])

+ 0 - 1
route/give_history_add.py

@@ -12,7 +12,6 @@ def give_history_add_2(conn, name):
 
         today = get_time()
         content = flask.request.form.get('content', '')
-        content = savemark(content)
         leng = '+' + str(len(content))
 
         history_plus(

+ 0 - 2
route/tool/set_mark/namumark.py

@@ -765,8 +765,6 @@ def namumark(conn, data, title, include_num):
     toc_data += '</div>'
     data = toc_re.sub(toc_data, data)
     
-    data = tool.savemark(data)
-    
     now_time = tool.get_time()
     time_data = re.search(r'^([0-9]{4}-[0-9]{2}-[0-9]{2})', now_time)
     time = time_data.group(1)

+ 0 - 10
route/tool/set_mark/tool.py

@@ -37,16 +37,6 @@ def ip_check(d_type = 0):
 
     return str(ip)
 
-def savemark(data):
-    data = re.sub(r"\[date\(now\)\]", get_time(), data)
-
-    ip = ip_check()
-    name = '[[user:' + ip + '|' + ip + ']]' if not re.search(r"\.|:", ip) else ip
-
-    data = re.sub(r"\[name\]", name, data)
-
-    return data
-
 def url_pas(data):
     return urllib.parse.quote(data).replace('/','%2F')
 

+ 0 - 1
route/topic.py

@@ -81,7 +81,6 @@ def topic_2(conn, topic_num):
                 ])
 
         data = re.sub(r"(?P<in>#(?:[0-9]+))", '[[\g<in>]]', data)
-        data = savemark(data)
 
         rd_plus(topic_num, today, name, sub)
         curs.execute(db_change("insert into topic (id, data, date, ip, code) values (?, ?, ?, ?, ?)"), [