diff --git a/database.go b/database.go index 9c98de3..130e4af 100644 --- a/database.go +++ b/database.go @@ -232,6 +232,13 @@ func gethonksforme(userid int64, wanted int64) []*Honk { 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 @@ func cleanupdb(arg string) { 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 @@ func prepareStatements(db *sql.DB) { 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) diff --git a/views/header.html b/views/header.html index 3f07332..4212c94 100644 --- a/views/header.html +++ b/views/header.html @@ -34,15 +34,16 @@
  • chatter
  • tags
  • events +
  • long ago
  • saved
  • honkers
  • filters -
  • my honks
  • account
  • more stuff