2016-12-03 13:45:08 +00:00
|
|
|
package main
|
2017-03-27 07:09:28 +00:00
|
|
|
|
2017-03-14 10:57:40 +00:00
|
|
|
//import "fmt"
|
2017-03-15 08:34:14 +00:00
|
|
|
import "strconv"
|
2017-01-26 13:37:50 +00:00
|
|
|
import _ "github.com/go-sql-driver/mysql"
|
2016-12-03 13:45:08 +00:00
|
|
|
|
2017-02-04 15:49:24 +00:00
|
|
|
type ForumAdmin struct
|
|
|
|
{
|
|
|
|
ID int
|
|
|
|
Name string
|
2017-06-05 11:57:27 +00:00
|
|
|
Desc string
|
2017-02-04 15:49:24 +00:00
|
|
|
Active bool
|
|
|
|
Preset string
|
|
|
|
TopicCount int
|
|
|
|
PresetLang string
|
|
|
|
}
|
|
|
|
|
2016-12-03 13:45:08 +00:00
|
|
|
type Forum struct
|
|
|
|
{
|
|
|
|
ID int
|
2017-06-28 12:05:26 +00:00
|
|
|
Slug string
|
2016-12-03 13:45:08 +00:00
|
|
|
Name string
|
2017-06-05 11:57:27 +00:00
|
|
|
Desc string
|
2016-12-06 10:26:48 +00:00
|
|
|
Active bool
|
2017-02-04 15:49:24 +00:00
|
|
|
Preset string
|
2017-01-26 13:37:50 +00:00
|
|
|
TopicCount int
|
2017-06-28 12:05:26 +00:00
|
|
|
LastTopicSlug string
|
2016-12-03 13:45:08 +00:00
|
|
|
LastTopic string
|
|
|
|
LastTopicID int
|
|
|
|
LastReplyer string
|
|
|
|
LastReplyerID int
|
|
|
|
LastTopicTime string
|
|
|
|
}
|
2016-12-04 10:44:28 +00:00
|
|
|
|
|
|
|
type ForumSimple struct
|
|
|
|
{
|
|
|
|
ID int
|
|
|
|
Name string
|
2016-12-07 09:34:09 +00:00
|
|
|
Active bool
|
2017-02-04 15:49:24 +00:00
|
|
|
Preset string
|
2017-01-01 15:45:43 +00:00
|
|
|
}
|
2017-01-26 13:37:50 +00:00
|
|
|
|
2017-06-28 12:05:26 +00:00
|
|
|
func build_forum_url(slug string, fid int) string {
|
|
|
|
if slug == "" {
|
|
|
|
return "/forum/" + strconv.Itoa(fid)
|
2017-01-26 13:37:50 +00:00
|
|
|
}
|
2017-06-28 12:05:26 +00:00
|
|
|
return "/forum/" + slug + "." + strconv.Itoa(fid)
|
2017-03-15 08:34:14 +00:00
|
|
|
}
|