diff --git a/.gitignore b/.gitignore index b515f1d9..c24d07cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ uploads/avatar_* -bin/* \ No newline at end of file +bin/* +gosora.exe +install.exe diff --git a/README.md b/README.md index 5b3911b1..ec4894fe 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ A responsive design. Looks great on mobile phones, tablets, laptops, desktops an Go 1.7. You will need to install this. Pick the .msi, if you want everything sorted out for you rather than having to go around updating the environment settings. https://golang.org/doc/install -MySQL Database. You will need to setup a MySQL Database somewhere. A MariaDB Database works equally well and is much faster than MySQL. +MySQL Database. You will need to setup a MySQL Database somewhere. A MariaDB Database works equally well and is much faster than MySQL. You could use something like WNMP / XAMPP which have a little PHP script called PhpMyAdmin for managing MySQL databases or you could install MariaDB directly. + Download the .msi installer from [MariaDB](https://mariadb.com/downloads) and run that. You may want to set it up as a service to avoid running it every-time the computer starts up. Instructions on how to set MariaDB up on Linux: https://downloads.mariadb.org/mariadb/repositories/ diff --git a/images/cosmo-320px.PNG b/images/cosmo-320px.PNG new file mode 100644 index 00000000..ba7148ab Binary files /dev/null and b/images/cosmo-320px.PNG differ diff --git a/images/cosmo-conflux.png b/images/cosmo-conflux.png index 6afc7984..f006518b 100644 Binary files a/images/cosmo-conflux.png and b/images/cosmo-conflux.png differ diff --git a/images/cosmo.png b/images/cosmo.png index 7d98fa0e..fb789415 100644 Binary files a/images/cosmo.png and b/images/cosmo.png differ diff --git a/images/levels2_test.PNG b/images/levels2_test.PNG new file mode 100644 index 00000000..4c973f1f Binary files /dev/null and b/images/levels2_test.PNG differ diff --git a/images/levels.PNG b/images/levels_test.PNG similarity index 100% rename from images/levels.PNG rename to images/levels_test.PNG diff --git a/images/panel-theme-list-test.PNG b/images/panel-theme-list-test.PNG deleted file mode 100644 index f2bd8399..00000000 Binary files a/images/panel-theme-list-test.PNG and /dev/null differ diff --git a/images/panel-theme-list-test2.PNG b/images/panel-theme-list-test2.PNG deleted file mode 100644 index efc08d84..00000000 Binary files a/images/panel-theme-list-test2.PNG and /dev/null differ diff --git a/images/panel-theme-list.PNG b/images/panel-theme-list.PNG index 8b8ab873..6510fd42 100644 Binary files a/images/panel-theme-list.PNG and b/images/panel-theme-list.PNG differ diff --git a/images/tempra-conflux-mobile-320px.png b/images/tempra-conflux-mobile-320px.png index 26a786ef..4612074a 100644 Binary files a/images/tempra-conflux-mobile-320px.png and b/images/tempra-conflux-mobile-320px.png differ diff --git a/images/tempra-conflux.png b/images/tempra-conflux.png index 43c881e3..6c3939a4 100644 Binary files a/images/tempra-conflux.png and b/images/tempra-conflux.png differ diff --git a/template_forum.go b/template_forum.go index 523a5f29..9758c3aa 100644 --- a/template_forum.go +++ b/template_forum.go @@ -1,7 +1,7 @@ /* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */ package main -import "io" import "strconv" +import "io" func init() { template_forum_handle = template_forum diff --git a/template_profile.go b/template_profile.go index c32f708a..5c02a28d 100644 --- a/template_profile.go +++ b/template_profile.go @@ -1,7 +1,7 @@ /* This file was automatically generated by the software. Please don't edit it as your changes may be overwritten at any moment. */ package main -import "strconv" import "io" +import "strconv" func init() { template_profile_handle = template_profile diff --git a/template_topic_alt.go b/template_topic_alt.go index 8c38e028..f0c947c0 100644 --- a/template_topic_alt.go +++ b/template_topic_alt.go @@ -118,6 +118,8 @@ w.Write([]byte(` `)) if tmpl_topic_alt_vars.Topic.Tag != "" { w.Write([]byte(`
` + tmpl_topic_alt_vars.Topic.Tag + `
`)) +} else { +w.Write([]byte(`
Level ` + strconv.Itoa(tmpl_topic_alt_vars.Topic.Level) + `
`)) } w.Write([]byte(` @@ -138,6 +140,8 @@ w.Write([]byte(` `)) if item.Tag != "" { w.Write([]byte(`
` + item.Tag + `
`)) +} else { +w.Write([]byte(`
Level ` + strconv.Itoa(item.Level) + `
`)) } w.Write([]byte(` diff --git a/templates/panel-themes.html b/templates/panel-themes.html index 10df91cd..fed30ebd 100644 --- a/templates/panel-themes.html +++ b/templates/panel-themes.html @@ -13,7 +13,7 @@ {{if .MobileFriendly}}📱{{end}} - {{if .Active}}Default{{else}}Make Default{{end}} + {{if .Active}}Default{{else}}Make Default{{end}} {{end}} diff --git a/templates/topic_alt.html b/templates/topic_alt.html index 45eaeb29..530a2c77 100644 --- a/templates/topic_alt.html +++ b/templates/topic_alt.html @@ -1,7 +1,7 @@ {{template "header.html" . }}
-
+
{{.Topic.Title}} {{if .Topic.Is_Closed}}🔒︎{{end}} {{if .CurrentUser.Is_Mod}} @@ -26,7 +26,7 @@
 
{{.Topic.CreatedByName}} - {{if .Topic.Tag}}
{{end}} + {{if .Topic.Tag}}
{{else}}
{{end}}
{{.Topic.Content}}
@@ -39,7 +39,7 @@
 
{{.CreatedByName}} - {{if .Tag}}
{{end}} + {{if .Tag}}
{{else}}
{{end}}
{{.ContentHtml}}
diff --git a/themes/cosmo-conflux/cosmo-conflux.png b/themes/cosmo-conflux/cosmo-conflux.png index 6afc7984..f006518b 100644 Binary files a/themes/cosmo-conflux/cosmo-conflux.png and b/themes/cosmo-conflux/cosmo-conflux.png differ diff --git a/themes/cosmo-conflux/public/main.css b/themes/cosmo-conflux/public/main.css index 7dc03095..c890041f 100644 --- a/themes/cosmo-conflux/public/main.css +++ b/themes/cosmo-conflux/public/main.css @@ -487,12 +487,12 @@ blockquote p margin-top: 3px; margin-bottom: 0; background: white; - min-height: 129px; + min-height: 145px; padding-bottom: 0; width: 100%; } .user_content.nobuttons { - min-height: 153px; + min-height: 168px; } .button_container { @@ -532,7 +532,11 @@ blockquote p padding-bottom: 2px; } .post_tag { - display: none; + margin-top: 0px; + text-align: center; + color: #505050; + display: block; + font-size: 13px; } .the_name { margin-top: 3px; @@ -574,27 +578,7 @@ blockquote p /* Responsive Layout */ /* Anything that isn't a small mobile */ @media(min-width: 501px) -{ - /*.top - { - margin-top: 0px; - margin-bottom: 0px; - margin-left: auto; - margin-right: auto; - width: 200px; - padding: 0px; - outline: none; - } - - .top h1 - { - text-align: center; - color: darkgray; - text-shadow: 0px 1px 0px #646464; - margin: 0px; - line-height: 60px; - }*/ - +{ .options { float: right; @@ -716,14 +700,7 @@ blockquote p @media (max-width: 800px) { - body { background: #cdcdcd; margin-bottom: 10px;} - /*.top - { - background: url('../../images/atombb-small.png') no-repeat left, url('../../images/head-bg.png'); - width: 100%; - } - .top img { display: none; }*/ - + body { background: #505050; margin-bottom: 10px;} #main { width: 100%; @@ -772,8 +749,13 @@ blockquote p .rowitem { border-left: none;border-right: none; } .rowhead { border-left: none;border-right: none; } .tbody { border-left: none;border-right: none; } - .cell_author img { display: none; } - .cell_last img { display: none; } +} + +@media(max-width: 620px) +{ + .menu_create_topic { display: none;} + .menu_overview { display: none; } + .hide_on_mobile { display: none; } } /* This one is specifically for small mobiles.. */ @@ -781,12 +763,12 @@ blockquote p { #main { margin-top: 20px; } .rowblock { box-sizing: border-box; } + .rowblock:first-of-type { margin-top: 2px; } body { overflow-x: hidden; } - h1 { font-size: 0; } - /*.top { display: none !important; }*/ + .topic_name { text-align: left; margin-left: 8px; width: 50%; text-overflow: ellipsis; overflow: hidden; } + .menu_profile { display: none; } .options { display: none !important; } - /*.top div {display: none;}*/ ul { line-height: 30px; @@ -857,23 +839,13 @@ blockquote p } .content_container { margin-left: 73px; + min-height: inherit; } + .user_content { min-height: 80px !important; } + .user_content.nobuttons { min-height: 103px !important; } } @media (min-width: 800px) { - /*.top { - min-height: 50px !important; - -webkit-animation-duration: 2s; - -moz-animation-duration: 2s; - animation-duration: 2s; - -webkit-animation-name: slidein; - -moz-animation-name: slidein; - animation-name: slidein; - } - .top a - { - height: 50px !important; - }*/ @-webkit-keyframes slidein { from { transform: translate(0,-50px) scale(0.75); } diff --git a/themes/cosmo-conflux/theme.json b/themes/cosmo-conflux/theme.json index 463e0adb..9dc15c44 100644 --- a/themes/cosmo-conflux/theme.json +++ b/themes/cosmo-conflux/theme.json @@ -4,6 +4,7 @@ "Version": "Coming Soon", "Creator": "Azareal", "FullImage": "cosmo-conflux.png", + "MobileFriendly": true, "Templates": [ { "Name": "topic", diff --git a/themes/cosmo/cosmo.png b/themes/cosmo/cosmo.png index 7d98fa0e..fb789415 100644 Binary files a/themes/cosmo/cosmo.png and b/themes/cosmo/cosmo.png differ diff --git a/themes/cosmo/public/main.css b/themes/cosmo/public/main.css index 159a3183..727a35ae 100644 --- a/themes/cosmo/public/main.css +++ b/themes/cosmo/public/main.css @@ -533,12 +533,13 @@ blockquote p margin-top: 3px; margin-bottom: 0; background: white; - min-height: 129px; + min-height: 167px; padding-bottom: 0; width: 100%; + border-radius: 4px; } .user_content.nobuttons { - min-height: 153px; + min-height: 190px; } .button_container { @@ -615,6 +616,7 @@ blockquote p margin-bottom: 0; margin-right: 3px; box-shadow:0 1px 2px rgba(0,0,0,.1); + border-radius: 4px; } /* Responsive Layout */ @@ -742,7 +744,7 @@ blockquote p @media (max-width: 800px) { - body { background: #cdcdcd; margin-bottom: 10px;} + body { background: #505050; margin-bottom: 10px;} #main { width: 100%; @@ -797,14 +799,23 @@ blockquote p .cell_last img { display: none; } } +@media(max-width: 620px) +{ + .menu_create_topic { display: none;} + .menu_overview { display: none; } + .hide_on_mobile { display: none; } +} + /* This one is specifically for small mobiles.. */ @media(max-width: 500px) { #main { margin-top: 20px; } .rowblock { box-sizing: border-box; } + .rowblock:first-of-type { margin-top: 2px; } body { overflow-x: hidden; } - h1 { font-size: 0; } + .topic_name { text-align: left; margin-left: 8px; width: 50%; text-overflow: ellipsis; overflow: hidden; } + .menu_profile { display: none; } .options { display: none !important; } ul { @@ -839,7 +850,6 @@ blockquote p padding-left: 4px; padding-right: 6px; } - .notice { width: 100%; @@ -878,7 +888,10 @@ blockquote p } .content_container { margin-left: 73px; + min-height: inherit; } + .user_content { min-height: 97.5px !important; } + .user_content.nobuttons { min-height: 121px !important; } } @media (min-width: 800px) { diff --git a/themes/cosmo/theme.json b/themes/cosmo/theme.json index 93543f96..526ba268 100644 --- a/themes/cosmo/theme.json +++ b/themes/cosmo/theme.json @@ -4,6 +4,7 @@ "Version": "Coming Soon", "Creator": "Azareal", "FullImage": "cosmo.png", + "MobileFriendly": true, "Templates": [ { "Name": "topic", diff --git a/themes/tempra-conflux/public/main.css b/themes/tempra-conflux/public/main.css index 02c7b080..00978d93 100644 --- a/themes/tempra-conflux/public/main.css +++ b/themes/tempra-conflux/public/main.css @@ -168,12 +168,10 @@ li a .formrow { - /*height: 40px;*/ width: 100%; } -/*Clearfix*/ -.formrow:before, -.formrow:after { +/* Clearfix */ +.formrow:before, .formrow:after { content: " "; display: table; } @@ -241,10 +239,7 @@ button color: #505050; /* 80,80,80 */ border-radius: 2px; } - -.topic_status:empty { - display: none; -} +.topic_status:empty { display: none; } .rowhead { background: linear-gradient(to bottom, white, hsl(0, 0%, 93%)); @@ -329,12 +324,12 @@ button.username margin-top: 3px; margin-bottom: 0; background: white; - min-height: 129px; + min-height: 145px; padding-bottom: 0; width: 100%; } .user_content.nobuttons { - min-height: 153px; + min-height: 168px; } .button_container { @@ -368,7 +363,7 @@ button.username padding-top: 4px; padding-left: 5px; clear: both; - border-bottom: none; + border-bottom: none !important; padding-right: 4px; padding-bottom: 2px; } @@ -376,7 +371,11 @@ button.username padding-bottom: 7px; } .post_tag { - display: none; + margin-top: 0px; + text-align: center; + color: #505050; + display: block; + font-size: 13px; } .the_name { margin-top: 3px; @@ -436,10 +435,7 @@ button.username font-weight: normal; text-transform: none; } - .rowitem - { - text-transform: none; - } + .rowitem { text-transform: none; } } @media (max-width: 620px) { @@ -501,7 +497,12 @@ button.username } .content_container { margin-left: 73px; + min-height: inherit !important; } + .user_content { min-height: 76.5px !important; font-size: 15px; } + .user_content.nobuttons { min-height: 100.5px !important; } + .the_name { font-size: 15px; } + .post_tag { font-size: 12px; } .container { width: 100% !important; } } \ No newline at end of file diff --git a/themes/tempra-conflux/tempra-conflux.png b/themes/tempra-conflux/tempra-conflux.png index 43c881e3..6c3939a4 100644 Binary files a/themes/tempra-conflux/tempra-conflux.png and b/themes/tempra-conflux/tempra-conflux.png differ diff --git a/themes/tempra-simple/public/main.css b/themes/tempra-simple/public/main.css index 3a83131b..92ef7861 100644 --- a/themes/tempra-simple/public/main.css +++ b/themes/tempra-simple/public/main.css @@ -274,6 +274,7 @@ button.username position: relative; top: -0.25px; } +.username.level {color: #303030;} .tag-mini { text-transform: none; @@ -388,11 +389,12 @@ button.username position: absolute; top: 70px; float: left; - margin-top: 0px; + margin-top: -2px; padding-top: 3px !important; margin-right: 2px; width: 60px; font-size: 15px; + text-align: center; } .container { width: 100% !important; } } \ No newline at end of file diff --git a/user.go b/user.go index 1f36ad5d..f6cfead4 100644 --- a/user.go +++ b/user.go @@ -1,5 +1,4 @@ package main -import "fmt" import "strings" import "strconv" import "net/http" @@ -226,8 +225,8 @@ func increase_post_user_stats(wcount int, uid int, topic bool, user User) error if err != nil { return err } - fmt.Println(user.Score + base_score + mod) - fmt.Println(getLevel(user.Score + base_score + mod)) + //fmt.Println(user.Score + base_score + mod) + //fmt.Println(getLevel(user.Score + base_score + mod)) _, err = update_user_level_stmt.Exec(getLevel(user.Score + base_score + mod), uid) return err } diff --git a/utils.go b/utils.go index 71faa5bb..16deb206 100644 --- a/utils.go +++ b/utils.go @@ -107,9 +107,8 @@ func write_file(name string, content string) { f.Close() } -func word_count(input string) int { +func word_count(input string) (count int) { input = strings.TrimSpace(input) - count := 0 in_space := false for _, value := range input { if unicode.IsSpace(value) {