Browse Source

add editor in recent discuss

잉여개발기 (SPDV) 3 years ago
parent
commit
fa056a2caa
1 changed files with 20 additions and 3 deletions
  1. 20 3
      route/recent_discuss.py

+ 20 - 3
route/recent_discuss.py

@@ -27,8 +27,9 @@ def recent_discuss(tool):
                 <table id="main_table_set">
                     <tbody>
                         <tr id="main_table_top_tr">
-                            <td id="main_table_width_half">''' + load_lang('discussion_name') + '''</td>
-                            <td id="main_table_width_half">''' + load_lang('time') + '''</td>
+                            <td id="main_table_width">''' + load_lang('discussion_name') + '''</td>
+                            <td id="main_table_width">''' + load_lang('editor') + '''</td>
+                            <td id="main_table_width">''' + load_lang('time') + '''</td>
                         </tr>
                 '''
 
@@ -39,17 +40,33 @@ def recent_discuss(tool):
         else:
             curs.execute(db_change('select title, sub, date, code from rd where stop != "O" order by date asc limit 50'))
 
-        for data in curs.fetchall():
+        db_data = curs.fetchall()
+
+        last_editor = []
+        for for_a in db_data:
+            curs.execute(db_change("select ip from topic where code = ? order by id + 0 desc limit 1"), [for_a[3]])
+            db_data_2 = curs.fetchall()
+            if db_data_2:
+                last_editor += [db_data_2[0][0]]
+            else:
+                last_editor += ['']
+
+        last_editor_ip_pas = ip_pas(last_editor)
+
+        count = 0
+        for data in db_data:
             div += '' + \
                 '<tr>' + \
                     '<td>' + \
                         '<a href="/thread/' + data[3] + '">' + html.escape(data[1]) + '</a> ' + \
                         '<a href="/topic/' + url_pas(data[0]) + '">(' + html.escape(data[0]) + ')</a>' + \
                     '</td>' + \
+                    '<td>' + last_editor_ip_pas[last_editor[count]] + '</td>' + \
                     '<td>' + data[2] + '</td>' + \
                 '</tr>' + \
             ''
 
+
         div += '' + \
                 '</tbody>' + \
             '</table>' + \