2016-12-11 16:06:17 +00:00
|
|
|
/* Copyright Azareal 2016 - 2017 */
|
2016-12-02 07:38:54 +00:00
|
|
|
package main
|
2016-12-03 04:50:35 +00:00
|
|
|
import "html/template"
|
2016-12-02 07:38:54 +00:00
|
|
|
|
2017-02-28 09:27:28 +00:00
|
|
|
type Reply struct /* Should probably rename this to ReplyUser and rename ReplyShort to Reply */
|
2016-12-02 07:38:54 +00:00
|
|
|
{
|
|
|
|
ID int
|
|
|
|
ParentID int
|
|
|
|
Content string
|
2017-02-11 14:51:16 +00:00
|
|
|
ContentHtml string
|
2016-12-02 07:38:54 +00:00
|
|
|
CreatedBy int
|
|
|
|
CreatedByName string
|
2017-02-11 14:51:16 +00:00
|
|
|
Group int
|
2016-12-02 07:38:54 +00:00
|
|
|
CreatedAt string
|
|
|
|
LastEdit int
|
|
|
|
LastEditBy int
|
2016-12-02 15:03:31 +00:00
|
|
|
Avatar string
|
2016-12-04 06:16:59 +00:00
|
|
|
Css template.CSS
|
2016-12-07 09:34:09 +00:00
|
|
|
ContentLines int
|
|
|
|
Tag string
|
2016-12-09 13:46:29 +00:00
|
|
|
URL string
|
|
|
|
URLPrefix string
|
|
|
|
URLName string
|
2017-01-12 02:55:08 +00:00
|
|
|
Level int
|
2017-01-17 07:55:46 +00:00
|
|
|
IpAddress string
|
2017-02-10 13:39:13 +00:00
|
|
|
Liked bool
|
|
|
|
LikeCount int
|
2017-04-02 13:00:40 +00:00
|
|
|
ActionType string
|
|
|
|
ActionIcon string
|
2016-12-02 07:38:54 +00:00
|
|
|
}
|
2017-02-10 13:39:13 +00:00
|
|
|
|
2017-02-28 09:27:28 +00:00
|
|
|
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}
|
2017-06-14 07:09:44 +00:00
|
|
|
err := get_reply_stmt.QueryRow(id).Scan(&reply.ParentID, &reply.Content, &reply.CreatedBy, &reply.CreatedAt, &reply.LastEdit, &reply.LastEditBy, &reply.IpAddress, &reply.LikeCount)
|
|
|
|
return &reply, err
|
|
|
|
}
|
|
|
|
|
|
|
|
func get_user_reply(id int) (*ReplyShort, error) {
|
|
|
|
reply := ReplyShort{ID:id}
|
|
|
|
err := get_user_reply_stmt.QueryRow(id).Scan(&reply.ParentID, &reply.Content, &reply.CreatedBy, &reply.CreatedAt, &reply.LastEdit, &reply.LastEditBy, &reply.IpAddress)
|
2017-02-28 09:27:28 +00:00
|
|
|
return &reply, err
|
|
|
|
}
|