few refinements to tags
This commit is contained in:
parent
108973ef7b
commit
194c9a1223
|
@ -678,6 +678,7 @@ func xonkxonk(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
|||
xonk.Onts = append(xonk.Onts, name)
|
||||
}
|
||||
}
|
||||
xonk.Onts = oneofakind(xonk.Onts)
|
||||
}
|
||||
if originate(xid) != origin {
|
||||
log.Printf("original sin: %s <> %s", xid, origin)
|
||||
|
@ -853,8 +854,7 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
|
|||
t["href"] = m.where
|
||||
tags = append(tags, t)
|
||||
}
|
||||
ooo := ontologies(h.Noise)
|
||||
for _, o := range ooo {
|
||||
for _, o := range h.Onts {
|
||||
t := junk.New()
|
||||
t["type"] = "Hashtag"
|
||||
o = strings.ToLower(o)
|
||||
|
|
9
honk.go
9
honk.go
|
@ -669,6 +669,9 @@ func thelistingoftheontologies(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
onts = append(onts, []string{o, o[1:]})
|
||||
}
|
||||
if u == nil {
|
||||
w.Header().Set("Cache-Control", "max-age=300")
|
||||
}
|
||||
templinfo := getInfo(r)
|
||||
templinfo["Onts"] = onts
|
||||
err = readviews.Execute(w, "onts.html", templinfo)
|
||||
|
@ -1309,10 +1312,10 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
return
|
||||
}
|
||||
onts := ontologies(honk.Noise)
|
||||
honk.Onts = oneofakind(ontologies(honk.Noise))
|
||||
res, err := stmtSaveHonk.Exec(userinfo.UserID, what, honk.Honker, xid, rid,
|
||||
dt.Format(dbtimeformat), "", aud, honk.Noise, convoy, whofore, "html",
|
||||
honk.Precis, honk.Oonker, 0, strings.Join(onts, " "))
|
||||
honk.Precis, honk.Oonker, 0, strings.Join(honk.Onts, " "))
|
||||
if err != nil {
|
||||
log.Printf("error saving honk: %s", err)
|
||||
http.Error(w, "something bad happened while saving", http.StatusInternalServerError)
|
||||
|
@ -1327,7 +1330,7 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
}
|
||||
for _, o := range onts {
|
||||
for _, o := range honk.Onts {
|
||||
_, err = stmtSaveOnts.Exec(strings.ToLower(o), honk.ID)
|
||||
if err != nil {
|
||||
log.Printf("error saving ont: %s", err)
|
||||
|
|
|
@ -146,7 +146,7 @@ func upgradedb() {
|
|||
onts := ontologies(noise)
|
||||
mo := re_more.FindAllString(noise, -1)
|
||||
for _, o := range mo {
|
||||
onts = append(onts, "#" + o[7:])
|
||||
onts = append(onts, "#"+o[7:])
|
||||
}
|
||||
if len(onts) > 0 {
|
||||
ontmap[honkid] = oneofakind(onts)
|
||||
|
|
Loading…
Reference in New Issue