gosora/reply.go
Azareal cf480947d3 I'm still working on alerts. I've worked out the client-side UI for Cosmo, the UI will be tweaked for the other themes shortly. The client-side JS also now pulls the alerts from the server.
The errors are now sent properly via JSON.
The success JSON messages are now sent properly.
Optimised the message for guests.
Added the opthead class for adding a nice Cosmo specific enhancement.
2017-03-01 11:36:50 +00:00

51 lines
957 B
Go

/* Copyright Azareal 2016 - 2017 */
package main
import "html/template"
type Reply struct /* Should probably rename this to ReplyUser and rename ReplyShort to Reply */
{
ID int
ParentID int
Content string
ContentHtml string
CreatedBy int
CreatedByName string
Group int
CreatedAt string
LastEdit int
LastEditBy int
Avatar string
Css template.CSS
ContentLines int
Tag string
URL string
URLPrefix string
URLName string
Level int
IpAddress string
Liked bool
LikeCount int
}
type ReplyShort struct
{
ID int
ParentID int
Content string
CreatedBy int
Group int
CreatedAt string
LastEdit int
LastEditBy int
ContentLines int
IpAddress string
Liked bool
LikeCount int
}
func get_reply(id int) (*ReplyShort, error) {
reply := ReplyShort{ID:id}
err := get_reply_stmt.QueryRow(id).Scan(&reply.Content, &reply.CreatedBy, &reply.CreatedAt, &reply.LastEdit, &reply.LastEditBy, &reply.IpAddress, &reply.LikeCount)
return &reply, err
}