Added lastOnline field to Person table in createdb.
This commit is contained in:
parent
ff22ee9243
commit
0936542368
4 changed files with 18 additions and 12 deletions
|
|
@ -1,9 +1,9 @@
|
|||
#
|
||||
#
|
||||
# The Nimrod Forum
|
||||
# (c) Copyright 2012 Andreas Rumpf
|
||||
#
|
||||
# All rights reserved.
|
||||
# (c) Copyright 2012 Andreas Rumpf, Dominik Picheta
|
||||
# Look at license.txt for more info.
|
||||
# All rights reserved.
|
||||
#
|
||||
|
||||
import cairo, os, strutils, jester
|
||||
|
|
|
|||
11
createdb.nim
11
createdb.nim
|
|
@ -1,9 +1,9 @@
|
|||
#
|
||||
#
|
||||
# Nimrod Forum
|
||||
# (c) Copyright 2012 Andreas Rumpf
|
||||
#
|
||||
# All rights reserved.
|
||||
# The Nimrod Forum
|
||||
# (c) Copyright 2012 Andreas Rumpf, Dominik Picheta
|
||||
# Look at license.txt for more info.
|
||||
# All rights reserved.
|
||||
#
|
||||
|
||||
import strutils, db_sqlite
|
||||
|
|
@ -37,7 +37,8 @@ create table if not exists person(
|
|||
creation timestamp not null default (DATETIME('now')),
|
||||
salt varbin(128) not null,
|
||||
status integer not null,
|
||||
admin bool default false
|
||||
admin bool default false,
|
||||
lastOnline timestamp not null default (DATETIME('now'))
|
||||
);""" % [TUserName, TPassword, TEmail]), [])
|
||||
# echo "person table already exists"
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,11 @@
|
|||
#end for
|
||||
</span>
|
||||
<hr/>
|
||||
<span>Total threads: ${stats.totalThreads} | Total posts: ${stats.totalPosts} | Newest member: ${stats.newestMember.nick}</span>
|
||||
#if stats.newestMember.nick != "":
|
||||
<span>Total threads: ${stats.totalThreads} | Total posts: ${stats.totalPosts} | Newest member: ${stats.newestMember.nick}</span>
|
||||
#else:
|
||||
<span>Total threads: ${stats.totalThreads} | Total posts: ${stats.totalPosts}</span>
|
||||
#end if
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#
|
||||
#
|
||||
# The Nimrod Forum
|
||||
# (c) Copyright 2012 Andreas Rumpf
|
||||
#
|
||||
# All rights reserved.
|
||||
# (c) Copyright 2012 Andreas Rumpf, Dominik Picheta
|
||||
# Look at license.txt for more info.
|
||||
# All rights reserved.
|
||||
#
|
||||
|
||||
import
|
||||
|
|
@ -451,6 +451,7 @@ proc getStats(c: var TForumData, simple: bool): TForumStats =
|
|||
if not simple:
|
||||
var newestMemberCreation = 0
|
||||
result.activeUsers = @[]
|
||||
result.newestMember = ("", -1, false)
|
||||
const getUsersQuery =
|
||||
sql"select id, name, admin, strftime('%s', lastOnline), strftime('%s', creation) from person"
|
||||
for row in fastRows(db, getUsersQuery):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue