add a long ago link...
Ted Unangst tedu@tedunangst.com
Sun, 19 Jul 2020 18:51:02 -0400
3 files changed,
24 insertions(+),
1 deletions(-)
M
database.go
→
database.go
@@ -232,6 +232,13 @@ dt := time.Now().UTC().Add(-7 * 24 * time.Hour).Format(dbtimeformat)
rows, err := stmtHonksForMe.Query(wanted, userid, dt, userid) return getsomehonks(rows, err) } +func gethonksfromlongago(userid int64, wanted int64) []*Honk { + now := time.Now().UTC() + dt1 := now.Add(-367 * 24 * time.Hour).Format(dbtimeformat) + dt2 := now.Add(-364 * 24 * time.Hour).Format(dbtimeformat) + rows, err := stmtHonksFromLongAgo.Query(wanted, userid, dt1, dt2, userid) + return getsomehonks(rows, err) +} func getsavedhonks(userid int64, wanted int64) []*Honk { rows, err := stmtHonksISaved.Query(wanted, userid) return getsomehonks(rows, err)@@ -849,6 +856,7 @@
var stmtHonkers, stmtDubbers, stmtNamedDubbers, stmtSaveHonker, stmtUpdateFlavor, stmtUpdateHonker *sql.Stmt var stmtAnyXonk, stmtOneXonk, stmtPublicHonks, stmtUserHonks, stmtHonksByCombo, stmtHonksByConvoy *sql.Stmt var stmtHonksByOntology, stmtHonksForUser, stmtHonksForMe, stmtSaveDub, stmtHonksByXonker *sql.Stmt +var stmtHonksFromLongAgo *sql.Stmt var stmtHonksByHonker, stmtSaveHonk, stmtUserByName, stmtUserByNumber *sql.Stmt var stmtEventHonks, stmtOneBonk, stmtFindZonk, stmtFindXonk, stmtSaveDonk *sql.Stmt var stmtFindFile, stmtGetFileData, stmtSaveFileData, stmtSaveFile *sql.Stmt@@ -893,6 +901,7 @@ myhonkers := " and honker in (select xid from honkers where userid = ? and (flavor = 'sub' or flavor = 'peep' or flavor = 'presub') and combos not like '% - %')"
stmtHonksForUser = preparetodie(db, selecthonks+"where honks.honkid > ? and honks.userid = ? and dt > ?"+myhonkers+butnotthose+limit) stmtHonksForUserFirstClass = preparetodie(db, selecthonks+"where honks.honkid > ? and honks.userid = ? and dt > ? and (what <> 'tonk')"+myhonkers+butnotthose+limit) stmtHonksForMe = preparetodie(db, selecthonks+"where honks.honkid > ? and honks.userid = ? and dt > ? and whofore = 1"+butnotthose+limit) + stmtHonksFromLongAgo = preparetodie(db, selecthonks+"where honks.honkid > ? and honks.userid = ? and dt < ? and dt > ? and whofore = 2"+butnotthose+limit) stmtHonksISaved = preparetodie(db, selecthonks+"where honks.honkid > ? and honks.userid = ? and flags & 4 order by honks.honkid desc") stmtHonksByHonker = preparetodie(db, selecthonks+"join honkers on (honkers.xid = honks.honker or honkers.xid = honks.oonker) where honks.honkid > ? and honks.userid = ? and honkers.name = ?"+butnotthose+limit) stmtHonksByXonker = preparetodie(db, selecthonks+" where honks.honkid > ? and honks.userid = ? and (honker = ? or oonker = ?)"+butnotthose+limit)
M
views/header.html
→
views/header.html
@@ -34,15 +34,16 @@ </details>
<li><a href="/chatter">chatter</a> <li><a href="/o">tags</a> <li><a href="/events">events</a> +<li><a href="/longago">long ago</a> <li><a id="savedlink" href="/saved">saved</a> <li><a href="/honkers">honkers</a> <li><a href="/hfcs">filters</a> -<li><a href="/{{ .UserSep }}/{{ .UserInfo.Username }}">my honks</a> <li><a href="/account">account</a> <li style="list-style-type:none; margin-left:-1em"> <details> <summary>more stuff</summary> <ul> +<li><a href="/{{ .UserSep }}/{{ .UserInfo.Username }}">my honks</a> <li><a href="/about">about</a> <li><a href="/front">front</a> <li><a href="/funzone">funzone</a>
M
web.go
→
web.go
@@ -117,6 +117,11 @@ templinfo["ServerMessage"] = "at me!"
templinfo["PageName"] = "atme" honks = gethonksforme(userid, 0) honks = osmosis(honks, userid, false) + case "/longago": + templinfo["ServerMessage"] = "long ago and far away!" + templinfo["PageName"] = "longago" + honks = gethonksforme(userid, 0) + honks = osmosis(honks, userid, false) case "/events": templinfo["ServerMessage"] = "some recent and upcoming events" templinfo["PageName"] = "events"@@ -2236,6 +2241,10 @@ case "atme":
honks = gethonksforme(userid, wanted) honks = osmosis(honks, userid, false) templinfo["ServerMessage"] = "at me!" + case "longago": + honks = gethonksfromlongago(userid, wanted) + honks = osmosis(honks, userid, false) + templinfo["ServerMessage"] = "from long ago" case "home": honks = gethonksforuser(userid, wanted) honks = osmosis(honks, userid, true)@@ -2328,6 +2337,9 @@ requery:
switch page { case "atme": honks = gethonksforme(userid, wanted) + honks = osmosis(honks, userid, false) + case "longago": + honks = gethonksfromlongago(userid, wanted) honks = osmosis(honks, userid, false) case "home": honks = gethonksforuser(userid, wanted)@@ -2502,6 +2514,7 @@ loggedin.HandleFunc("/account", accountpage)
loggedin.HandleFunc("/funzone", showfunzone) loggedin.HandleFunc("/chpass", dochpass) loggedin.HandleFunc("/atme", homepage) + loggedin.HandleFunc("/longago", homepage) loggedin.HandleFunc("/hfcs", hfcspage) loggedin.HandleFunc("/xzone", xzone) loggedin.HandleFunc("/newhonk", newhonkpage)