From f96479423f325cf4c7c13a3c647691cd5ee1a095 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 26 Sep 2019 11:28:05 -0400 Subject: [PATCH] a page with no replies --- database.go | 8 +++++++- views/header.html | 1 + views/honkpage.js | 4 +++- web.go | 7 +++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/database.go b/database.go index 42eadee..8204b6a 100644 --- a/database.go +++ b/database.go @@ -119,6 +119,11 @@ func gethonksforuser(userid int64) []*Honk { 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 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 @@ func prepareStatements(db *sql.DB) { 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) diff --git a/views/header.html b/views/header.html index 0a699fc..84c2cb9 100644 --- a/views/header.html +++ b/views/header.html @@ -20,6 +20,7 @@ menu