From 049131ef34fb3254300a9b32bdbe053de81c3ba9 Mon Sep 17 00:00:00 2001 From: Azareal Date: Wed, 15 Mar 2017 09:34:07 +0000 Subject: [PATCH] The default topic should now be posted in the right forum. Fixed install-gosora-linux Fixed the staff mark-up on the opening posts. Fixed the lack of group tags on the opening posts. --- data.sql | 2 +- install-gosora-linux | 7 ++++++- routes.go | 7 ++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/data.sql b/data.sql index c5a0874d..6bed1d25 100644 --- a/data.sql +++ b/data.sql @@ -223,7 +223,7 @@ INSERT INTO forums_permissions(`gid`,`fid`,`permissions`) VALUES (4,1,'{}'); INSERT INTO forums_permissions(`gid`,`fid`,`permissions`) VALUES (5,1,'{}'); INSERT INTO forums_permissions(`gid`,`fid`,`permissions`) VALUES (6,1,'{}'); INSERT INTO topics(`title`,`content`,`createdAt`,`lastReplyAt`,`createdBy`,`parentID`) -VALUES ('Test Topic','A topic automatically generated by the software.',NOW(),NOW(),1,1); +VALUES ('Test Topic','A topic automatically generated by the software.',NOW(),NOW(),1,2); INSERT INTO replies(`tid`,`content`,`createdAt`,`createdBy`,`lastEdit`,`lastEditBy`) VALUES (1,'Reply 1',NOW(),1,0,0); \ No newline at end of file diff --git a/install-gosora-linux b/install-gosora-linux index 19372ad5..5a2ada69 100644 --- a/install-gosora-linux +++ b/install-gosora-linux @@ -6,5 +6,10 @@ go get -u golang.org/x/crypto/bcrypt echo "Preparing the installer" go generate go build -o Gosora -go build ./install +cd ./install +go build -o Install +mv ./Install .. +cd .. + +echo "Running the installer" ./Install \ No newline at end of file diff --git a/routes.go b/routes.go index b52fc779..7bc9e5e7 100644 --- a/routes.go +++ b/routes.go @@ -330,9 +330,9 @@ func route_topic_id(w http.ResponseWriter, r *http.Request){ user.Perms.CreateReply = false } - if groups[topic.Group].Is_Mod { + topic.Tag = groups[topic.Group].Tag + if groups[topic.Group].Is_Mod || groups[topic.Group].Is_Admin { topic.Css = staff_css_tmpl - topic.Level = -1 } /*if settings["url_tags"] == false { @@ -378,12 +378,13 @@ func route_topic_id(w http.ResponseWriter, r *http.Request){ replyItem.ParentID = topic.ID replyItem.ContentHtml = parse_message(replyItem.Content) replyItem.ContentLines = strings.Count(replyItem.Content,"\n") + if groups[replyItem.Group].Is_Mod || groups[replyItem.Group].Is_Admin { replyItem.Css = staff_css_tmpl - replyItem.Level = -1 } else { replyItem.Css = no_css_tmpl } + if replyItem.Avatar != "" { if replyItem.Avatar[0] == '.' { replyItem.Avatar = "/uploads/avatar_" + strconv.Itoa(replyItem.CreatedBy) + replyItem.Avatar