diff --git a/Encyclopedia/factoids.cgi b/Encyclopedia/factoids.cgi index ece16e7..d25c25c 100755 --- a/Encyclopedia/factoids.cgi +++ b/Encyclopedia/factoids.cgi @@ -113,6 +113,7 @@ def link(match): i = 0 for f in factoids: f = list(f) + name = f[0] f[2] = f[2][:30] if '.' in f[3]: f[3] = f[3][:f[3].find('.')] @@ -122,10 +123,19 @@ for f in factoids: f[1] += ' $hr$' + ' $hr$'.join([x[0] for x in more]) cur.execute("SELECT name FROM facts WHERE value LIKE %s", ' ' + f[0]) f[0] += ' \n' + ' \n'.join([x[0] for x in cur.fetchall()]) + data = [ q(x) for x in f ] + cur.execute("SELECT author, added FROM log WHERE name = %s ORDER BY id DESC LIMIT 1", name) + edit = cur.fetchall() + if edit: + who, when = edit[0] + who = who[:who.find('!')] + when = when[:when.find('.')] + edit = "
Last edited by %s:
%s" %(q(who), q(when)) + data[3] += edit print '%s%s%s
Added on: %s
Requested %s times' % tuple([q(x) for x in f]) + print '>%s%s%s
Added on: %s
Requested %s times' % tuple(data) print ''