a page with no replies
Ted Unangst tedu@tedunangst.com
Thu, 26 Sep 2019 11:28:05 -0400
4 files changed,
18 insertions(+),
2 deletions(-)
M
database.go
→
database.go
@@ -119,6 +119,11 @@ dt := time.Now().UTC().Add(-7 * 24 * time.Hour).Format(dbtimeformat)
rows, err := stmtHonksForUser.Query(userid, dt, userid, userid) return getsomehonks(rows, err) } +func gethonksforuserfirstclass(userid int64) []*Honk { + dt := time.Now().UTC().Add(-7 * 24 * time.Hour).Format(dbtimeformat) + rows, err := stmtHonksForUserFirstClass.Query(userid, dt, userid, userid) + return getsomehonks(rows, err) +} func gethonksforme(userid int64) []*Honk { dt := time.Now().UTC().Add(-7 * 24 * time.Hour).Format(dbtimeformat) rows, err := stmtHonksForMe.Query(userid, dt, userid)@@ -343,7 +348,7 @@ var stmtAddDoover, stmtGetDoovers, stmtLoadDoover, stmtZapDoover, stmtOneHonker *sql.Stmt
var stmtThumbBiters, stmtDeleteHonk, stmtDeleteDonks, stmtDeleteOnts, stmtSaveZonker *sql.Stmt var stmtGetZonkers, stmtRecentHonkers, stmtGetXonker, stmtSaveXonker, stmtDeleteXonker *sql.Stmt var stmtSelectOnts, stmtSaveOnt, stmtUpdateFlags, stmtClearFlags *sql.Stmt -var stmtSaveOld, stmtUpdateHonk *sql.Stmt +var stmtHonksForUserFirstClass, stmtSaveOld, stmtUpdateHonk *sql.Stmt func preparetodie(db *sql.DB, s string) *sql.Stmt { stmt, err := db.Prepare(s)@@ -369,6 +374,7 @@ stmtOneBonk = preparetodie(db, selecthonks+"where honks.userid = ? and xid = ? and what = 'bonk' and whofore = 2")
stmtPublicHonks = preparetodie(db, selecthonks+"where whofore = 2 and dt > ?"+limit) stmtUserHonks = preparetodie(db, selecthonks+"where (whofore = 2 or whofore = ?) and username = ? and dt > ?"+limit) stmtHonksForUser = preparetodie(db, selecthonks+"where honks.userid = ? and dt > ? and honker in (select xid from honkers where userid = ? and flavor = 'sub' and combos not like '% - %')"+butnotthose+limit) + stmtHonksForUserFirstClass = preparetodie(db, selecthonks+"where honks.userid = ? and dt > ? and (what <> 'tonk') and honker in (select xid from honkers where userid = ? and flavor = 'sub' and combos not like '% - %')"+butnotthose+limit) stmtHonksForMe = preparetodie(db, selecthonks+"where honks.userid = ? and dt > ? and whofore = 1"+butnotthose+limit) stmtHonksByHonker = preparetodie(db, selecthonks+"join honkers on (honkers.xid = honks.honker or honkers.xid = honks.oonker) where honks.userid = ? and honkers.name = ?"+butnotthose+limit) stmtHonksByXonker = preparetodie(db, selecthonks+" where honks.userid = ? and (honker = ? or oonker = ?)"+butnotthose+limit)
M
views/header.html
→
views/header.html
@@ -20,6 +20,7 @@ <details id="topmenu">
<summary>menu</summary> <p> <ul> +<li><a id="firstlink" href="/first">first</a> <li><a href="/{{ .UserSep }}/{{ .UserInfo.Username }}">{{ .UserInfo.Username }}</a> <li><a href="/honkers">honkers</a> <li style="list-style-type:none; margin-left:-1em">
M
views/honkpage.js
→
views/honkpage.js
@@ -166,8 +166,10 @@ }
(function() { var el = document.getElementById("homelink") el.onclick = pageswitcher("home", "") - var el = document.getElementById("atmelink") + el = document.getElementById("atmelink") el.onclick = pageswitcher("atme", "") + el = document.getElementById("firstlink") + el.onclick = pageswitcher("first", "") relinklinks() window.onpopstate = statechanger history.replaceState(curpagestate, "some title", "")
M
web.go
→
web.go
@@ -90,6 +90,10 @@ userid = u.UserID
if r.URL.Path == "/atme" { templinfo["PageName"] = "atme" honks = gethonksforme(userid) + } else if r.URL.Path == "/first" { + templinfo["PageName"] = "first" + honks = gethonksforuser(userid) + honks = osmosis(honks, userid) } else { templinfo["PageName"] = "home" honks = gethonksforuser(userid)@@ -1418,6 +1422,9 @@ case "atme":
honks = gethonksforme(userid) case "home": honks = gethonksforuser(userid) + honks = osmosis(honks, userid) + case "first": + honks = gethonksforuserfirstclass(userid) honks = osmosis(honks, userid) case "combo": c := r.FormValue("c")