Surplus_Up (2DU) před 6 roky
rodič
revize
ff459aa84c
3 změnil soubory, kde provedl 20 přidání a 23 odebrání
  1. 13 20
      route/recent_changes.py
  2. 6 2
      route/view_read.py
  3. 1 1
      version.json

+ 13 - 20
route/recent_changes.py

@@ -54,7 +54,7 @@ def recent_changes_2(conn, name, tool):
                     plus_list = [name, sql_num]
 
                 curs.execute(db_change('' + \
-                    'select id, title, date, ip, send, leng from history ' + \
+                    'select id, title, date, ip, send, leng, hide from history ' + \
                     plus_sql + \
                     'order by id + 0 desc ' + \
                     "limit ?, 50" + \
@@ -69,7 +69,7 @@ def recent_changes_2(conn, name, tool):
                 div = '<a href="/topic_record/' + url_pas(name) + '">(' + load_lang('discussion') + ')</a><hr class=\"main_hr\">' + div
 
                 curs.execute(db_change('' + \
-                    'select id, title, date, ip, send, leng from history ' + \
+                    'select id, title, date, ip, send, leng, hide from history ' + \
                     "where ip = ? and type = '' order by date desc limit ?, 50" + \
                 ''), [name, sql_num])
         else:
@@ -95,7 +95,7 @@ def recent_changes_2(conn, name, tool):
                 plus_sql = "where not title like 'user:%' and type = '' "
 
             curs.execute(db_change('' + \
-                'select id, title, date, ip, send, leng from history ' + \
+                'select id, title, date, ip, send, leng, hide from history ' + \
                 plus_sql + \
                 'order by date desc ' + \
                 'limit ?, 50' + \
@@ -128,29 +128,22 @@ def recent_changes_2(conn, name, tool):
             style = ['', '']
             date = data[2]
 
-            curs.execute(db_change('''
-                select title from history
-                where title = ? and id = ? and hide = 'O'
-            '''), [data[1], data[0]])
-            hide = curs.fetchall()
-
-            if admin_check(6) == 1:
-                if hide:
+            print(data)
+            if data[6] == 'O':
+                if admin_check(6) == 1:
                     style[0] = 'id="toron_color_grey"'
                     style[1] = 'id="toron_color_grey"'
 
                     send += ' (' + load_lang('hide') + ')'
-            elif not hide:
-                pass
-            else:
-                ip = ''
-                ban = ''
-                date = ''
+                else:
+                    ip = ''
+                    ban = ''
+                    date = ''
 
-                send = '(' + load_lang('hide') + ')'
+                    send = '(' + load_lang('hide') + ')'
 
-                style[0] = 'style="display: none;"'
-                style[1] = 'id="toron_color_grey"'
+                    style[0] = 'style="display: none;"'
+                    style[1] = 'id="toron_color_grey"'
 
             if tool == 'history':
                 title = '<a href="/w/' + url_pas(name) + '?num=' + data[0] + '">r' + data[0] + '</a> '

+ 6 - 2
route/view_read.py

@@ -132,8 +132,12 @@ def view_read_2(conn, name):
         else:
             end_data = '<h2>' + load_lang('error') + '</h2><ul><li>' + load_lang('decument_404_error') + '</li></ul>'
 
-        curs.execute(db_change('select ip, date, leng, send from history where title = ? order by id desc limit 3'), [name])
+        curs.execute(db_change('' + \
+            'select ip, date, leng, send, id from history ' + \
+            'where title = ? and hide != "O" and type = "" order by id desc limit 3' + \
+        ''), [name])
         sql_d = curs.fetchall()
+        print(sql_d)
         if sql_d:
             end_data += '<h2>' + load_lang('history') + '</h2><ul>'
             for i in sql_d:
@@ -144,7 +148,7 @@ def view_read_2(conn, name):
                 else:
                     leng = '<span style="color:gray;">(' + i[2] + ')</span>'
 
-                end_data += '<li>' + i[1] + ' | ' + ip_pas(i[0]) + ' | ' + leng + (' | ' + i[3] if i[3] != '' else '') + '</li>'
+                end_data += '<li>' + i[1] + ' | r' + i[4] + ' | ' + ip_pas(i[0]) + ' | ' + leng + (' | ' + i[3] if i[3] != '' else '') + '</li>'
 
             end_data += '<li><a href="/history/' + url_pas(name) + '">(...)</a></li></ul>'
     else:

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.7-master-31",
+        "r_ver" : "v3.1.7-master-32",
         "c_ver" : "3172800",
         "s_ver" : "8"
     }, "stable" : {