diff --git a/routes/forum.go b/routes/forum.go index fddeee10..c6846952 100644 --- a/routes/forum.go +++ b/routes/forum.go @@ -32,7 +32,7 @@ func ViewForum(w http.ResponseWriter, r *http.Request, user c.User, header *c.He page, _ := strconv.Atoi(r.FormValue("page")) _, fid, err := ParseSEOURL(sfid) if err != nil { - return c.PreError(phrases.GetErrorPhrase("url_id_must_be_integer"), w, r) + return c.SimpleError(phrases.GetErrorPhrase("url_id_must_be_integer"),w,r,header) } ferr := c.ForumUserCheck(header, w, r, &user, fid) diff --git a/routes/panel/forums.go b/routes/panel/forums.go index d9658d76..e09c5014 100644 --- a/routes/panel/forums.go +++ b/routes/panel/forums.go @@ -165,12 +165,12 @@ func ForumsEdit(w http.ResponseWriter, r *http.Request, user c.User, sfid string if !user.Perms.ManageForums { return c.NoPermissions(w, r, user) } - basePage.Header.AddScriptAsync("panel_forum_edit.js") - + fid, err := strconv.Atoi(sfid) if err != nil { - return c.LocalError("The provided Forum ID is not a valid number.", w, r, user) + return c.SimpleError(phrases.GetErrorPhrase("url_id_must_be_integer"),w,r,basePage.Header) } + basePage.Header.AddScriptAsync("panel_forum_edit.js") forum, err := c.Forums.Get(fid) if err == sql.ErrNoRows { diff --git a/routes/reply.go b/routes/reply.go index cc99a739..7a8f711f 100644 --- a/routes/reply.go +++ b/routes/reply.go @@ -64,7 +64,7 @@ func CreateReplySubmit(w http.ResponseWriter, r *http.Request, user c.User) c.Ro return c.NoPermissionsJSQ(w, r, user, js) } - content := c.PreparseMessage(r.PostFormValue("reply-content")) + content := c.PreparseMessage(r.PostFormValue("content")) // TODO: Fully parse the post and put that in the parsed column rid, err := c.Rstore.Create(topic, content, user.LastIP, user.ID) if err != nil { @@ -86,8 +86,8 @@ func CreateReplySubmit(w http.ResponseWriter, r *http.Request, user c.User) c.Ro } if r.PostFormValue("has_poll") == "1" { - var maxPollOptions = 10 - var pollInputItems = make(map[int]string) + maxPollOptions := 10 + pollInputItems := make(map[int]string) for key, values := range r.Form { //c.DebugDetail("key: ", key) //c.DebugDetailf("values: %+v\n", values) @@ -466,7 +466,6 @@ func ProfileReplyCreateSubmit(w http.ResponseWriter, r *http.Request, user c.Use if !user.Perms.ViewTopic || !user.Perms.CreateReply { return c.NoPermissions(w, r, user) } - uid, err := strconv.Atoi(r.PostFormValue("uid")) if err != nil { return c.LocalError("Invalid UID", w, r, user) @@ -479,7 +478,10 @@ func ProfileReplyCreateSubmit(w http.ResponseWriter, r *http.Request, user c.Use return c.InternalError(err, w, r) } - content := c.PreparseMessage(r.PostFormValue("reply-content")) + content := c.PreparseMessage(r.PostFormValue("content")) + if len(content) == 0 { + return c.LocalError("You can't make a blank post", w, r, user) + } // TODO: Fully parse the post and store it in the parsed column _, err = c.Prstore.Create(profileOwner.ID, content, user.ID, user.LastIP) if err != nil { @@ -500,7 +502,6 @@ func ProfileReplyCreateSubmit(w http.ResponseWriter, r *http.Request, user c.Use func ProfileReplyEditSubmit(w http.ResponseWriter, r *http.Request, user c.User, srid string) c.RouteError { isJs := (r.PostFormValue("js") == "1") - rid, err := strconv.Atoi(srid) if err != nil { return c.LocalErrorJSQ("The provided Reply ID is not a valid number.", w, r, user, isJs) diff --git a/templates/profile.html b/templates/profile.html index 8e1478a7..9a539d78 100644 --- a/templates/profile.html +++ b/templates/profile.html @@ -1,5 +1,4 @@ {{template "header.html" . }} -
@@ -18,7 +17,7 @@ -
+
{{.CurrentScore}} / {{.NextScore}}
@@ -28,6 +27,9 @@ {{if not .CurrentUser.Loggedin}}{{else}} + @@ -95,9 +97,9 @@ {{if not .CurrentUser.IsBanned}}
-
+
-
+
@@ -106,12 +108,11 @@ {{end}} {{else}} -
+
{{lang "profile_comments_form_guest"}}
{{end}}
- {{template "footer.html" . }} \ No newline at end of file diff --git a/templates/topic.html b/templates/topic.html index c2fad3e8..a6132737 100644 --- a/templates/topic.html +++ b/templates/topic.html @@ -74,10 +74,10 @@
- +
- +
diff --git a/templates/topic_alt_quick_reply.html b/templates/topic_alt_quick_reply.html index f2ca5fc1..1c8d6de0 100644 --- a/templates/topic_alt_quick_reply.html +++ b/templates/topic_alt_quick_reply.html @@ -12,7 +12,7 @@
- +