better listing of onts
Ted Unangst tedu@tedunangst.com
Tue, 27 Aug 2019 22:07:08 -0400
1 files changed,
7 insertions(+),
2 deletions(-)
jump to
M
honk.go
→
honk.go
@@ -649,7 +649,12 @@ honkpage(w, r, u, nil, honks, template.HTML(html.EscapeString("honks by ontology: "+name)))
} func thelistingoftheontologies(w http.ResponseWriter, r *http.Request) { - rows, err := stmtSelectOnts.Query() + u := login.GetUserInfo(r) + var userid int64 = -1 + if u != nil { + userid = u.UserID + } + rows, err := stmtSelectOnts.Query(userid) if err != nil { log.Printf("selection error: %s", err) return@@ -1814,7 +1819,7 @@ stmtDeleteXonker = preparetodie(db, "delete from xonkers where name = ? and flavor = ?")
stmtRecentHonkers = preparetodie(db, "select distinct(honker) from honks where userid = ? and honker not in (select xid from honkers where userid = ? and flavor = 'sub') order by honkid desc limit 100") stmtUpdateFlags = preparetodie(db, "update honks set flags = flags | ? where honkid = ?") stmtClearFlags = preparetodie(db, "update honks set flags = flags & ~ ? where honkid = ?") - stmtSelectOnts = preparetodie(db, "select distinct(ontology) from onts join honks on onts.honkid = honks.honkid where honks.whofore = 2") + stmtSelectOnts = preparetodie(db, "select distinct(ontology) from onts join honks on onts.honkid = honks.honkid where (honks.userid = ? or honks.whofore = 2)") } func ElaborateUnitTests() {