+{{range .NoticeList}}
{{.}}
{{end}}
\ No newline at end of file
diff --git a/themes.go b/themes.go
index fc84fbab..94a95e1b 100644
--- a/themes.go
+++ b/themes.go
@@ -104,8 +104,9 @@ func add_theme_static_files(themeName string) {
path = strings.TrimPrefix(path,"themes/" + themeName + "/public")
log.Print("Added the '" + path + "' static file for default theme " + themeName + ".")
+ gzip_data := compress_bytes_gzip(data)
- static_files["/static" + path] = SFile{data,compress_bytes_gzip(data),0,int64(len(data)),mime.TypeByExtension(filepath.Ext("/themes/" + themeName + "/public" + path)),f,f.ModTime().UTC().Format(http.TimeFormat)}
+ static_files["/static" + path] = SFile{data,gzip_data,0,int64(len(data)),int64(len(gzip_data)),mime.TypeByExtension(filepath.Ext("/themes/" + themeName + "/public" + path)),f,f.ModTime().UTC().Format(http.TimeFormat)}
return nil
})
if err != nil {
diff --git a/themes/cosmo-conflux/public/main.css b/themes/cosmo-conflux/public/main.css
index 393f7b55..600700a0 100644
--- a/themes/cosmo-conflux/public/main.css
+++ b/themes/cosmo-conflux/public/main.css
@@ -174,7 +174,6 @@ hr { color: silver; border: 1px solid silver; }
.rowhead span { display: block; padding-top: 5px; }
.colhead a { color: white; display: block; padding-top: 5px; }
.colhead span { display: block; padding-top: 5px; }
-.open_edit { display: none !important; }
.show_on_edit { display: none; }
.rowhead .topic_status_e { display: none !important; }
.topic_button { float: right; position: relative; top: -22px; margin-right: 2px; border-style: solid !important; }
diff --git a/themes/cosmo/public/main.css b/themes/cosmo/public/main.css
index e1938bcd..8400a5e0 100644
--- a/themes/cosmo/public/main.css
+++ b/themes/cosmo/public/main.css
@@ -171,7 +171,6 @@ hr { color: silver; border: 1px solid silver; }
.rowhead span { display: block; padding-top: 5px; }
.colhead a { color: white; display: block; padding-top: 5px; }
.colhead span { display: block; padding-top: 5px; }
-.open_edit { display: none !important; }
.show_on_edit { display: none; }
.rowhead .topic_status_e { display: none !important; }
.topic_button { float: right; position: relative; top: -22px; margin-right: 2px; border-style: solid !important; }
diff --git a/topic.go b/topic.go
index ce37a0e5..9372c410 100644
--- a/topic.go
+++ b/topic.go
@@ -144,13 +144,15 @@ func (sts *StaticTopicStore) Load(id int) error {
err := get_topic_stmt.QueryRow(id).Scan(&topic.Title, &topic.Content, &topic.CreatedBy, &topic.CreatedAt, &topic.Is_Closed, &topic.Sticky, &topic.ParentID, &topic.IpAddress, &topic.PostCount, &topic.LikeCount)
if err == nil {
sts.Set(topic)
+ } else {
+ sts.Remove(id)
}
return err
}
func (sts *StaticTopicStore) Set(item *Topic) error {
sts.mu.Lock()
- item, ok := sts.items[item.ID]
+ _, ok := sts.items[item.ID]
if ok {
sts.items[item.ID] = item
} else if sts.length >= sts.capacity {
@@ -158,9 +160,9 @@ func (sts *StaticTopicStore) Set(item *Topic) error {
return ErrStoreCapacityOverflow
} else {
sts.items[item.ID] = item
+ sts.length++
}
sts.mu.Unlock()
- sts.length++
return nil
}
diff --git a/user.go b/user.go
index e05e7496..b9a93c17 100644
--- a/user.go
+++ b/user.go
@@ -118,6 +118,7 @@ func (sts *StaticUserStore) Load(id int) error {
user := &User{ID:id,Loggedin:true}
err := get_full_user_stmt.QueryRow(id).Scan(&user.Name, &user.Group, &user.Is_Super_Admin, &user.Session, &user.Email, &user.Avatar, &user.Message, &user.URLPrefix, &user.URLName, &user.Level, &user.Score, &user.Last_IP)
if err != nil {
+ sts.Remove(id)
return err
}
@@ -136,7 +137,7 @@ func (sts *StaticUserStore) Load(id int) error {
func (sts *StaticUserStore) Set(item *User) error {
sts.mu.Lock()
- item, ok := sts.items[item.ID]
+ _, ok := sts.items[item.ID]
if ok {
sts.items[item.ID] = item
} else if sts.length >= sts.capacity {
@@ -144,9 +145,9 @@ func (sts *StaticUserStore) Set(item *User) error {
return ErrStoreCapacityOverflow
} else {
sts.items[item.ID] = item
+ sts.length++
}
sts.mu.Unlock()
- sts.length++
return nil
}