Commit Graph

97 Commits

Author SHA1 Message Date
Azareal 0e9cebfa47 Overhauled the widget system. You can now specify more complex logic for where a widget can show up and you can now place widgets in the footer.
Added fsnotify as a dependency, we'll be using it, Rez, and Riot (maybe) soon.
Removed the intercept_build_widgets vhook.
You can now pass an ID to BlankReply() for mocking replies or whatever else you want to do with this.
Added the dock template function for widget docks.
Added the logf internal function to the template transpiler and did some minor clean-up.
Removed the Sidebars property from theme.json and added the more general Docks one.
Improved the footer and the associated CSS.
Added the about widget, previously the AboutSegment feature.
Removed the about_segment_title and about_segment_body settings.
Gosora now exits when it receives the appropriate OS signal.
Refactored the modlogs route.

More progress on the theme in the Control Panel.
2017-11-29 02:34:02 +00:00
Azareal 381ce3083a Added the AboutSegment feature, you can see this in use on Cosora, it's a little raw right now, but I'm planning to polish it in the next commit.
Refactored the code to use switches instead of if blocks in some places.
Refactored the Dashboard to make it easier to add icons to it like I did with Cosora.
You can now use maps in transpiled templates.
Made progress on Cosora's footer.
Swapped out the ThemeName property in the HeaderVars struct for a more general and flexible Theme property.
Added the colstack CSS class to make it easier to style the layouts for the Control Panel and profile.
Renamed the FStore variable to Forums.
Renamed the Fpstore variable to FPStore.
Renamed the Gstore variable to Groups.
Split the MemoryTopicStore into DefaultTopicStore and MemoryTopicCache.
Split the MemoryUserStore into DefaultUserStore and MemoryUserCache.
Removed the NullUserStore, SQLUserStore, and SQLTopicStore.
Added the NullTopicCache and NullUserCache.
Moved the Reload method out of the TopicCache interface and into the TopicStore one.
Moved the Reload method out of the UserCache interface and into the UserStore one.
Added the SetCache and GetCache methods to the TopicStore and UserStore.
Added the BypassGetAll method to the WordFilterMap type.
Renamed routePanelSetting to routePanelSettingEdit.
Renamed routePanelSettingEdit to routePanelSettingEditSubmit.
Moved the page titles into the english language pack.
Split main() into main and afterDBInit to avoid code duplication in general_test.go
Added the ReqIsJson method so that we don't have to sniff the headers every time.
Added the LogStore interface.
Added the SQLModLogStore and the SQLAdminLogStore.
Refactored the phrase system to use getPhrasePlaceholder instead of hard-coding the string to return in a bunch of functions.
Removed a redundant rank check.
Added the GuildStore to plugin_guilds.
Added the about_segment_title and about_segment_body settings.
Refactored the setting system to use predefined errors to make it easier for an upstream caller to filter out sensitive error messages as opposed to safe errors.
Added the BypassGetAll method to the SettingMap type.
Added the Update method to the SettingMap type.
BulkGet is now exposed via the MemoryUserCache.
Refactored more logs in the template transpiler to reduce the amount of indentation.
Refactored the tests to take up fewer lines.
Further improved the Cosora theme's colours, padding, and profiles.
Added styling for the Control Panel Dashboard to the Cosora Theme.
Reduced the amount of code duplication in the installer query generator and opened the door to certain types of auto-migrations.
Refactored the Control Panel Dashboard to reduce the amount of code duplication.
Refactored the modlog route to reduce the amount of code duplication and string concatenation.
2017-11-23 05:37:08 +00:00
Azareal 8d0479f4b2 Renamed setting.go to settings.go
Added the BypassGet method to SettingMap and refactored the Control Panel to use it.
Refactored the query builder.

More work on Cosora.
2017-11-13 09:23:43 +00:00
Azareal f1c418bd13 Refactored the routing logic.
Continued refactoring the prequeries.
Continued work on the profiles.
Moved more logic out of the routes.
2017-11-12 07:18:25 +00:00
Azareal f8e892da20 Added the Rez Image Resizer as a dependency to be used later.
Is Codebeat fixed now?
Fixed a data race in PreRoute and refactored away the duplicate IP Address loads.
Renamed some of the variables in the query generator.
Slight bit more progress on Cosora.
2017-11-10 00:16:15 +00:00
Azareal 34ca7de946 Added the Not method to the router generator.
Refactored the router generator.

Added the NoBanned and NoSessionMismatch middlewares.
Removed some of the implicit returns.
Refactored some of the routes and their associated stores.
Added more Codebeat exclusions.
Added the AddReply method to *Topic.
Added the Like method to *Topic.
MemberOnly now emits a LoginRequired error rather than a generic NoPermissions error.

Made progress with Cosora, this time with the profile system.
2017-11-08 07:28:33 +00:00
Azareal 569b424ac8 Did a bit of refactoring on the template system.
Refactored the ReplyStore.
Added the Create method to the ProfileReplyStore.
Fixed a potential issue with the topics and replies generated by the installer.
Refactored the accumulator.
Refactored global.js

Added more tests.
2017-11-06 16:24:45 +00:00
Azareal d0ffc4be78 Refactored a few bits and pieces.
Added Riot as a dependency, I'm still deciding over whether to use this or Bleve.
Tweaked the topic view for Cosora.
Fixed a crash bug in the group creator.
Moved a few things from permissions.go into the ForumPermsStore, more to come here!
Added more tests.
Refactored the MySQL Query Generator.
Refactored the BBCode Parser.
Moved the presets into the Phrase System.
2017-11-05 01:04:57 +00:00
Azareal d0363f3eb1 Refactored the GroupStore to make it more thread-safe.
Refactored the store initialisers to better propogate errors upwards.
Moved the user initialisation logic to a method on *User.
Added the Reload and GlobalCount methods to the GroupStore.
Added the CacheSet method to the GroupCache.

Renamed plugin_socialgroups to plugin_guilds 3/3
2017-11-02 13:35:19 +00:00
Azareal f20a9966da Renamed plugin_socialgroups to plugin_guilds 1/3 2017-11-02 04:12:51 +00:00
Azareal 6f45c62815 We made more progress with topic views on Cosora. We accidentally broke Tempra Conflux's topic view in the process and we're planning to fix it in the following commit.
Added the ForumPermsStore.
Fixed the creation dates of the posts.
Added a skippable version of the vhooks.
Social Groups now work again, although I'm planning to refactor them ;)
Added more Markdown tests and fixed a few Markdown bugs.
2017-11-02 02:52:21 +00:00
Azareal 14a14b7e80 More work on Cosora, we have a screenshot of it up now, although it's super experimental at the moment.
This commit might be a little broken, another is coming to fix things up!

The topics list is now paginated.
Refactored the error handling system.
Added the Trumboyg WYSIWYG editor for Cosora.
Moved Delete() out of the TopicStore and into *Topic
You can now bulk delete and bulk lock topics on Cosora.
h1s are now formatted properly on Firefox.
Added more ARIA Labels.
SuperModOnly is now a piece of middleware for the Control Panel routes.
Refactored and extended the router generator.
Improved the SEO for the paginators.
Added bits of Microdata to improve SEO further.
Wrote benchmarks for users.Get() and users.BypassGet()
More errors are caught now.
You can now attach pcss files to posts.
Improved the error logging for JavaScript.
Topic list avatars now link to the associated profiles.
Added last poster avatars to the forum list.
2017-10-30 09:57:08 +00:00
Azareal f7942b42ac Continued the work on Cosora.
Trying to add support for Travis CI.

Added the NullUserStore for tests.
Moved more text out of the templates.
Removed an unnecessary dependency for Cosora.
Fixed a few more bugs in the MSSQL Adapter.
Disabled upserts for now, as it isn't working on MySQL.
Refactored the scheduled group logic to reduce the number of potential bugs and to stop using upserts.
Fixed many bugs in the Markdown Plugin.
Added the ability to escape Markdown.
Fixed a number of tests, commented unneccesary ones, and added new ones to probe for new problems.
Added the wink smiley.
Cleaned up some of the JavaScript.
Refactored the permissions logic to use transactions and avoid duplicating logic.
Added the ChangeRank method to the Group struct.
Added the ChangeGroup method to the User struct.
Added the currently unused LogWarning function.
Added the transaction versions of the builder methods. Better ones coming up soon!
The IsBanned flag is always set to false on mod and admin groups now.
Refactored the group creation logic to use transactions.
Fixed a bug in the group creator where new groups aren't visible to Exists().
The installer now drops tables for MySQL Databases, if they already exist to make it easier for us to run automated tests.
Added more ARIA Attributes.
2017-10-21 01:27:47 +01:00
Azareal fdb6304e32 Mostly a mid-way technical commit to make reading diffs easier on me.
Split the relativeTime function into relativeTime and relativeTimeFromString.
Refactored the installer.
Made a lot of progress with PgSQL and MSSQL support, mostly MSSQL.
Made a lot of progress on the automated testing suite.
Added eqcss to the file extension list.
..depressed..
Fixed various bugs here and there.
gen_mysql.go is now properly excluded when the pgsql or mssql build tag is passed.
The BBCode plugin is now always initialised prior to it's test.
We've begun transitioning towards deserializing database times directly into time.Times rather than doing it every time on the spot.
Added more dev flags.
The tests now make use of a test database rather than the production database.
2017-10-14 08:39:22 +01:00
Azareal 97860d4f79 Began work on the new theme, Cosora.
Added the ReplyStore and the ProfileReplyStore.
Added more allowed file extensions for attachments.
The tif, webp, and apng extensions are now recognised as images.
Added the Delete method to the Reply struct.
Added the Like method to the Reply struct.
Refactored the topic list avatars to make things easier on Cosora.
The attachment cap should now work properly on topics.
You can now attach files to replies.
The Markdown parser now ignores URLs rather than mangling them.
Fixed a bug where themes weren't able to register custom resources.
Added the ability to embed images.
Added the ability to embed videos.
Made the requirements for URLs looser.

Misc improvements to the themes and templates.
2017-10-12 04:24:14 +01:00
Azareal 22650aad27 Added Quick Topic.
Added Attachments.
Added Attachment Media Embeds.

Renamed a load of *Store and *Cache methods to reduce the amount of unneccesary typing.
Added petabytes as a unit and cleaned up a few of the friendly units.
Refactored the username change logic to make it easier to maintain.
Refactored the avatar change logic to make it easier to maintain.
Shadow now uses CSS Variables for most of it's colours. We have plans to transpile this to support older browsers later on!
Snuck some CSS Variables into Tempra Conflux.
Added the GroupCache interface to MemoryGroupStore.
Added the Length method to MemoryGroupStore.
Added support for a site short name.
Added the UploadFiles permission.
Renamed more functions.
Fixed the background for the left gutter on the postbit for Tempra Simple and Shadow.
Added support for if statements operating on int8, int16, int32, int32, int64, uint, uint8, uint16, uint32, uint64, float32, and float64 for the template compiler.
Added support for if statements operating on slices and maps for the template compiler.
Fixed a security exploit in reply editing.
Fixed a bug in the URL detector in the parser where it couldn't find URLs with non-standard ports.
Fixed buttons having blue outlines on focus on Shadow.
Refactored the topic creation logic to make it easier to maintain.

Made a few responsive fixes, but there's still more to do in the following commits!
2017-10-05 11:20:28 +01:00
Azareal 47963e10a9 Began work on support for JS Plugins.
Renamed the rrow_assign hook to topic_reply_row_assign and gave it access to more data.
Fixed a bug where the topic store wouldn't fetch the last reply time for a topic.
Refactored the process of adding and removing topics from and to a *Forum.
Fixed a bug where editing the opening post of a topic would yield a vast number of <br>s instead of blank lines.
Selecting text in Shadow now has it's own CSS instead of falling back onto the browser defaults.
Fixed a bug in Shadow where not all the headers filled up the space they should.
Fixed a bug in Shadow where the footer is broken on mobile.
Added an ARIA Label to the topic list.
Refactored the last poster logic to reduce the number of bugs.
Renamed ReplyShort to Reply and Reply to ReplyUser.
Added a Copy method to Reply, Group, Forum, User, and Topic.
Rewrote Hello World into something slightly more useful for new plugin devs to learn off.
Added the GetLength() method to ForumCache.
2017-09-28 23:16:34 +01:00
Azareal f5d5f755bb Added the Update method to *Forum and fixed a bug where forum updates would bypass the forumView cache.
Fixed a bug in MemoryForumStore's CacheSet where it requires new entries to exist, even though they don't need to.
Fixed a bug where the Reports could be deleted.
Fixed a bug in the JS where the inline forum editor stopped working.
Fixed a bug in Shadow where the Add Group header was pushed to the side by the previous element's margin.
Fixed a bug in the Forum Editor where the Active input's initial value was inverted.
2017-09-25 01:48:35 +01:00
Azareal b955f677a7 Fixed the permission system.
Added more debug logging.
Renamed the label in the Forum Manager and Editor from Hidden to Active.
Fixed a bug in compileTemplates() where it only loads visible forums from the forum store possibly causing trouble.
Fixed a bug in the /topics/ route where super admin status wasn't being taken into consideration.
Dropped down a hotfix for the /topics/ route.
2017-09-24 01:49:41 +01:00
Azareal 96b157e5aa Fixed a few regressions and renamed a file. 2017-09-23 21:46:28 +01:00
Azareal 11c60b3cbe You can now search for whatever IP you want in the IP Searcher.
Removed the Uncategorised Forum.
Added the Backup Page for super admins. Not quite functional yet.
Forums are now sorted properly again.
Fixed a bug in DirtyGet() where invalid IDs would trigger a panic.
Fixed a bug where alternate themes wouldn't work without setting them as default first and restarting Gosora.
2017-09-23 20:57:13 +01:00
Azareal 31f506c50c Removed the images for Cosmo from /images/, it's very saddening to see it go :(
Moved Reload from the UserStore into the UserCache.
Replaced many of the calls to Reload with CacheRemove.
Simplified the error functions.
Fixed a bug in the errors where they didn't have any CSS. Oops.
Added CustomErrorJS(), unused for now, but it may be useful in the future, especially for plugins.
Fixed many problems in the themes.
Added the Stick(), Unstick(), CreateActionReply(), Lock() and Unlock() methods to *Topic.
Renamed ip-search.html to ip-search-results.html
Added the Activate() and initPerms methods to *User.

Tempra Cursive is hiding from sight for this one commit.
Added Font Awesome to /public/, it isn't used yet.
2017-09-22 03:21:17 +01:00
Azareal 217e7abab3 Another mooostly technical commit, don't worry we'll be getting to the fun stuff soon!
The query statements now use camelCase instead of undercase.
Added more documentation.
Renamed a few config variables.
The length counters in the MemoryUserStore and MemoryTopicStore are now atomic.
Added the Flush method to the UserCache and TopicCache.
Made more visual improvements to Tempra Conflux.
The avatar block vanished from the opening posts for topics for some reason, I added it back.
Added more tests.

And many more changes...
2017-09-18 18:03:52 +01:00
Azareal 2557eb935b Added the GroupStore.
Renamed the *Store methods.
Added more functionality to some of the DataStores.
Added DataCache interfaces in addition to the DataStores to help curb their unrelenting growth and confusing APIs.
Fixed a crash bug in the ForumStore getters.
Fixed three tests.
Added more tests.
Temporary Group permissions should now be applied properly.
Improved the Tempra Conflux theme.
Moved the topic deletion logic into the TopicStore.
Tweaked the permission checks on the member routes to make them more sensible.
2017-09-15 23:20:01 +01:00
Azareal ce9195c841 Revamped Tempra Conflux.
Updated the readme.
Added more comments.
The forumView cache for MemoryForumStore now excludes Social Groups.
Moved the word filter logic into it's own file.
You can now change the language via the configuration file.
Moved the inline CSS into the CSS files.
2017-09-13 16:09:13 +01:00
Azareal 91f70d2a4a Add a per-user theme switcher. The CSS might be slightly broken in the themes, that'll be fixed in a follow-up commit.
Added basic support for server sync.

Re-added a few missing defers.
Renamed TO-DO to TODO across the entire codebase.
Renamed StaticForumStore to MemoryForumStore.
The ForumStore is now built on a sync.Map with a view slice for generating /forums rather than a slice.
Renamed many more functions and variables to satisfy the linter.
increase_post_user_stats() and decrease_post_user_stats() are now methods on the User struct. We also fix a bug where they take the moderator's score rather than the target user's into account when recalculating their level after a post / topic is deleted.
Transitioned the topic list to CSS Grid for Tempra Simple, with a float fallback.
Cosmo and Cosmo Conflux are now hidden from the theme list.
Fixed more data races.
Added more debug data to the template compiler logs.
2017-09-10 17:57:22 +01:00
Azareal ba36814d8d Refactored the code to follow best standards better.
Added Basic IP Search.
Added more items to .gitignore
Add a VSCode settings file.
Refactored the theme system to allow me to add a per-user theme switcher in the following commit.
Fixed h1s, rowmenus, profiles and the Control Panel Dashboard on Tempra Simple.
We now catch more extreme edge case errors.
Renamed route_panel_themes_default to route_panel_themes_set_default.
Centralised some of the per-route ExtData fields.
Added an ExtData field to headerLite.
Moved SettingLabels into the Phrase System.
2017-09-03 05:50:31 +01:00
Azareal 99da1fcbaa Added support for word filters.
Added support for temporary bans.
Moved the Gosora specific template logic out of main.go and into template_init.go

Added an internal temporary group API.
We now use h1s in the theme headers. There may be some issues with the themes other than Shadow which we may need to resolve.
Added ARIA attributes in a few places for improved accessibility.
Added support for inputs in links for the .edit_field API.
Removed a few unneccesary prepared statements.
2017-08-27 10:33:45 +01:00
Azareal 34b02336ed Fixed a crash bug caused by the previous commit.
Renamed a few templates.
Added the required attribute to a few form inputs.
2017-08-20 11:11:49 +01:00
Azareal 409719d10e Added support for screen readers.
Refactored the setting system to make it thread-safe.
Planned out the task system.
Fixed the closed topic status header.
2017-08-20 10:39:02 +01:00
Azareal 166d96e3b2 You can now dismiss alerts.
Refactored the API system.
Fixed a bug in the default topic where the forum didn't have a time set.
The JS is now run in strict mode.
Fixed a bug in the titles where they broke onto multiple lines.
Fixed a bug in create topic where the datetime wasn't getting set for the forum.
Fixed a bug in create reply where the local cache wasn't getting updated.
Fixed a bug in create reply where the wrong forum was getting updated.

Phased out jQuery in a few bits of JS to make it easier to understand.
2017-08-18 13:16:56 +01:00
Azareal ca9c755a47 Added support for desktop notifications.
The alert list is now visible on the Shadow Theme.

The User Manager is now paginated.
The Moderation Logs are now paginated.
The Group Manager is now paginated.
The alert counter no longer shows up as undefined on Edge.
Added a cache control header to the static files.
Fixed a few bits of mangled HTML.
Fixed the Forum Manager CSS for the Shadow Theme.
2017-08-17 12:13:49 +01:00
Azareal 3e4cfa8888 Added the Panel Debug page.
Added the mini stats for the various parts of the Control Panel in the Control Panel Menu.
Fixed a crash bug in the router.
The basic arithmetic template functions now work for the interpreted templates.
Tweaked the connection pool to hopefully ease the number of goroutines fighting over a database connection.
The Group Manager is now paginated.
panel.css is now pushed by HTTP/2 Push.
Fixed an issue with the padding on /forum/ and /topics/ for Shadow.
Fixed a bug in the login system forcefully overriding sessions on login.
All admin logins are now logged.
Refactored the client-side alert loading logic.
Added SimpleCount to the Query Builder.
2017-08-15 14:47:56 +01:00
Azareal f41c281e43 Added support for HTTP/2 Push.
The themes are still going to be a little broken for a while, but here's the progress I've made.

Renamed the topics_trow_assign hook to topics_topic_row_assign.
Added more debug code to the generated router.
Added a robots.txt file.
Gosora now responds to favicon.ico requests with a 404 rather than the topic list.
Fixed the tests and some of the benchmarks.
Changed the default UserCacheCapacity from 100 to 120.
Changed the default TopicCacheCapacity from 100 to 200.
Added the last replyer to the topics list and the forum pages.
Added the BulkCascadeGetMap method to the UserStore.
Refactored the topics list and forum page to load the users with a call to the UserStore rather than via a join.
WebSockets now work on SSL.
Fixed a race condition when the user permissions are initialised at the start of a request.
Fixed a race condition when the user permissions for the OP of a topic are initialised.
The rows.Close() calls are deferred once more, so that we can catch problems with recover()
Improved support for struct pointers in the template compiler.
Added a pin emoji to pinned topics to make them stand-out on the Shadow theme, we have some other ideas in mind for this, but I'd like to get Shadow fully functional for this commit.
Fixed a bug an issue with Chrome not detecting XHTML style closes on <form>s.
Fixed a visual issue with `color` not being set for textarea elements for the Shadow theme.
Fixed a function which wasn't getting renamed for PGSQL.

Added seven new UserStore tests.
2017-08-06 16:22:18 +01:00
Azareal 41c620b988 Shadow is now fully responsive and almost done! Just a few places like the dashboard and a few glitches to patch up!
Fixed the indentation in alerts.go, Atom replaced the tabs with spaces for some reason x.x
Made the friendly URL logic more flexible.
Made the supermod menu item hiding more JS friendly.
strconv is now an optional dependency for compiled template files.
Revamped the profile template.
2017-07-29 15:04:20 +01:00
Azareal 02a0cbb6bb More work on the Shadow theme.
Switched gopsutil with a temporary more stable fork.
Ping PostgreSQL upon connecting. We need a global solution for connection drops. A connection timeout, perhaps?
Added the rowmenu CSS class for styling sidebar menus.
Added the real_first_child CSS class, we might be able to get around using it by redoing the <form> nesting.
Added the rowlist CSS class.
Added the bgavatars CSS class.
Added avatars to the User Manager.
Added limited responsivity to the Shadow Theme, I might have broken some things in the other themes, I'll fix that soon!
A per-theme post-avatar-bg.jpg file is now used for the first topic layout rather than the global white-dot.jpg file.
2017-07-29 11:36:39 +01:00
Azareal d976a192fb Added the new theme, Shadow. It still isn't complete yet.
Revamped the configuration system.
If you have trouble installing this, try installing my fork of gopsutil with `go get` and delete the users_penalties table from the schema folder. That stuff will be cleaned up in the next commit.

Fixed an issue with the links for the Uncategorised forum being broken.
Swapped out NOW() for UTC_TIMESTAMP() in MySQL queries.
We now get an error message when the server goes down for whatever reason.
The template compiler now supports pointers.
Swapped out shirou/gopsutil for a fork locked on an older and more stable commit of the same library.
Fixed a bug where the preprocessor didn't play nice with empty CSS files.

Added the site name to the navbar.
Added more things to .gitignore
Laid the foundations for the next commit.
2017-07-17 11:23:42 +01:00
Azareal e30707bc17 Refactored the installer's code. We're moving towards supporting multiple database engines.
More progress has been made with PostgreSQL, but it's still incomplete and experimental.
The items on the Social Group menu bar are no longer decorative and now let you jump from page to page.
Social Group permissions are now fully functional. More features to come like privacy levels, secondary board permissions, etc. for Social Groups.

One of our dependencies added a dependecy, so we've added that dependency as a dependency.
Tweaked the ForumStore to better conform to the tests.
Fixed an issue with the generated file comment stopping the build tags from being read by the compiler for a few files.
Fixed the test system.
Renamed the route_create_topic handler to route_topic_create_submit
Moved the user table into the query generator.
Fixed a bug in MySQL where it doesn't allow unique keys longer than 180 characters.
Fixed a race condition in the forum deletion handler.
Fixed a crash bug where Gosora crashes when [rand]0[/rand] is passed to the BBCode parser.
Fixed a bug with superadmins not being able to see all the forums they should be able to.
Fixed a bug in simple_forum_session_check where it assumes every request has an error.

Tests:
Added 8 ForumStore tests.
Added 4 Auth tests.
Added 14 bbcode_full_parse tests.
Added 4 bbcode_regex_parse tests.
Fixed a bug in one of the bbcode_full_parse tests.

Apparently, routes.go wasn't commited in the previous commit o_o
2017-07-12 12:05:18 +01:00
Azareal dd8f68b6d2 Added the Social Groups plugin. This is still under construction.
Made a few improvements to the ForumStore, including bringing it's API closer in line with the other datastores, adding stubs for future subforum functionality, and improving efficiency in a few places.
The auth interface now handles all the authentication stuff.
Renamed the debug config variable to debug_mode.
Added the PluginPerms API.
Internal Errors will now dump the stack trace in the console.
Added support for installable plugins.
Refactored the routing logic so that the router now handles the common PreRoute logic(exc. /static/)
Added the CreateTable method to the query generator. It might need some tweaking to better support other database systems.
Added the same CreateTable method to the query builder.
Began work on PostgreSQL support.

Added the string-string hook type
Added the pre_render hook type.
Added the ParentID and ParentType fields to forums.
Added the get_forum_url_prefix function.
Added a more generic build_slug function.
Added the get_topic_url_prefix function.
Added the override_perms and override_forum_perms functions for bulk setting and unsetting permissions.
Added more ExtData fields in a few structs and removed them on the Perms struct as the PluginPerms API supersedes them there.
Plugins can now see the router instance.
The plugin initialisation handlers can now throw errors.
Plugins are now initialised after all the forum's subsystems are.
Refactored the unit test logic. For instance, we now use the proper .Log method rather than fmt.Println in many cases.
Sorry, we'll have to break Github's generated file detection, as the build instructions aren't working, unless I put them at the top, and they're far, far more important than getting Github to recognise the generated code as generated code.
Fixed an issue with mysql.go's _init_database() overwriting the dbpassword variable. Not a huge issue, but it is a "gotcha" for those not expecting a ':' at the start.
Fixed an issue with forum creation where the forum permissions didn't get cached.
Fixed a bug in plugin_bbcode where negative numbers in rand would crash Gosora.
Made the outputs of plugin_markdown and plugin_bbcode more compliant with the tests.
Revamped the phrase system to make it easier for us to add language pack related features in the future.
Added the WidgetMenu widget type.
Revamped the theme again. I'm experimenting to see which approach I like most.
- Excuse the little W3C rage. Some things about CSS drive me crazy :p

Tests:
Added 22 bbcode_full_parse tests.
Added 19 bbcode_regex_parse tests.
Added 27 markdown_parse tests.
Added four UserStore tests. More to come when the test database functionality is added.
Added 18 name_to_slug tests.

Hooks:
Added the pre_render hook.
Added the pre_render_forum_list hook.
Added the pre_render_view_forum hook.
Added the pre_render_topic_list hook.
Added the pre_render_view_topic hook.
Added the pre_render_profile hook.
Added the pre_render_custom_page hook.
Added the pre_render_overview hook.
Added the pre_render_create_topic hook.

Added the pre_render_account_own_edit_critical hook.
Added the pre_render_account_own_edit_avatar hook.
Added the pre_render_account_own_edit_username hook.
Added the pre_render_account_own_edit_email hook.
Added the pre_render_login hook.
Added the pre_render_register hook.
Added the pre_render_ban hook.

Added the pre_render_panel_dashboard hook.
Added the pre_render_panel_forums hook.
Added the pre_render_panel_delete_forum hook.
Added the pre_render_panel_edit_forum hook.
Added the pre_render_panel_settings hook.
Added the pre_render_panel_setting hook.
Added the pre_render_panel_plugins hook.
Added the pre_render_panel_users hook.
Added the pre_render_panel_edit_user hook.
Added the pre_render_panel_groups hook.
Added the pre_render_panel_edit_group hook.
Added the pre_render_panel_edit_group_perms hook.
Added the pre_render_panel_themes hook.
Added the pre_render_panel_mod_log hook.
Added the pre_render_error hook.
Added the pre_render_security_error hook.

Added the create_group_preappend hook.
Added the intercept_build_widgets hook.
Added the simple_forum_check_pre_perms hook.
Added the forum_check_pre_perms hook.
2017-07-09 13:06:04 +01:00
Azareal 9a93f799bf Added friendly URLs.
Added the Forum Store. Rewrote all the forum slice calls to use it.

Remapped sql.ErrNoRows to ErrNoRows for portability.
Removed a pointless column in the login query.
Revamped the tags and buttons on Tempra Simple, and on the profiles for the other themes.
Fixed a padding bug.
Tweaked the font sizes and padding in the Control Panel for Tempra Simple.
More progress with widgets.
2017-06-28 13:05:26 +01:00
Azareal 21d623cba4 Static CSS files are now processed by the template system. This will be most likely be superseded by a more sophisticated system in the future.
Added the authentication interface and associated struct to better organise / escapsulate the authentication logic.
Added the LogError function. We'll put together a custom logger at some point which will supersede this.
Reorganised things a little.
Moved two queries into the query generator and inlined four with the query builder.
Added SimpleInsertLeftJoin to the query generator.
Added SimpleInsertSelect, SimpleInsertLeftJoin, and SimpleInsertInnerJoin to the query builder.
Removed the undocumented password reset mechanism for security reasons. We have a proper interface for this in the control panel.
Made one of the template compiler errors less cryptic.
Fixed the CSS on widget_simple.
Fixed a glitch in the weak password detector regarding unique character detection.
Moved the responsive CSS in media.partial.css for Tempra Conflux, and Tempra Simple.
Added the CreateUser method to the UserStore.
Users are no longer logged out on all devices when logging out.

Took the first step towards SEO URLs.
2017-06-25 10:56:39 +01:00
Azareal 1cc1e47582 Added an algorithm for sniffing out weak passwords upon registration.
Themes can now inject their own stylesheets and JavaScript files into the header.

Added friendlier errors for developers / designers when something goes wrong in the system.
Moved three queries to the query generator.
_process_where() in the query generator now uses an arbitrary expression parser, thus allowing more complex constructs like IN.
Began work on the widget system.
Added SimpleLeftJoin and SimpleInnerJoin to the inline query builder.
Added SimpleInsertSelect and SimpleInsertInnerJoin to the query generator.
_process_columns() now supports parametisation.
Fixed a bug in _process_set() where _ was considered an invalid character in column names.
Fixed a typo in the interpreter template mapping for topics.
2017-06-19 09:06:54 +01:00
Azareal c4e109adb7 Added the HeaderVars struct which is now used in the header template.
The NoticeList field in the various page structs is now part of the HeaderVars struct.
The Left / Right hotkeys will no longer take you to the next or previous page, if you have a textarea, input, or select element selected.
Added the panel.css file.
Added the PanelSessionCheck and SimplePanelSessionCheck functions.
Reworked the ExtData field in the page structs, we'll have some hooks for you to inject stuff in here soon!
Fixed a problem with the templates not getting remapped properly with Tempra Conflux when the compiled templates are missing.
More Atom Madness.
2017-06-16 11:41:30 +01:00
Azareal 29d9d07cde Added Live Alerts for replies to posts.
Added relative times to posts.
Added push_alerts to the WebSockets Hub.
Added simple_delete, purge, and simple_inner_join to the query generator.
Query generator joiners now take not equals into account.
Other query generator stuff and query refactoring.
Fixed a weird padding bug on Tempra Conflux.
Fixed a couple of megapost_min_chars and bigpost_min_chars which I missed.
Fixed a security exploit in the login system.
2017-06-12 10:03:14 +01:00
Azareal 81af085c7a Added support for Live Likes, the first step towards Live Alerts.
Moved 26 queries into the query generator.
Added support for sime replace queries in the query generator.
The alert list can only have eight entries now.
Users can no longer like their own posts.
Renamed the bigpost_min_chars setting to bigpost_min_words.
Renamed the megapost_min_chars setting to megapost_min_words.
Moved the alert building logic into it's own file.
Fixed a bug in the megapost and bigpost algorithms where only posts larger than the minimum would be considered.

Renamed the GuestCount and UserCount methods for WebSockets to guest_count and user_count.
Added the broadcast_message, push_message, and push_alert methods to the WebSockets Hub.
2017-06-10 08:58:15 +01:00
Azareal a2fec5bc82 Bug fix commit and more query gen stuff.
Updated README.md
Moved 29 queries to the query generator.
The query generator now supports simple updates.
Tables are now escaped by the query generator.
Fixed the logout link in the menu.
Fixed not being able to login, if the user data is cached.
Fixed not being logged out after changing your password.
Fixed the notices being transparent on Tempra Conflux.
2017-06-07 11:07:40 +01:00
Azareal e099dfd40e Added the query generator. It's a work in progress and in constant flux.
Added forum descriptions.
Began work on the Advanced Forum Editor. Not to be confused with the Quick Forum Editor. You can access it by going to /panel/forums/edit/{forumid} We'll fix it so the Forum Manager links to it in the next commit.
Fixed the Linux shell scripts.
Fixed an issue with relative timess being off by an hour due to timezones.
Added reply count and author names to the topic list and forum pages.
Improved the look of the forum list, forum page, and topic list.
Added an overlay effect for when the alert list is open on mobile.
You can now close the alert list by clicking on the bell.
Removed the "Report:" prefix from report posts.
Fixed a bug in the template system where "and" and "or" wouldn't work on non-boolean values.
Improved the debug logging in the template system.
Fixed a bug in the forum creator where the "Hidden?" value was inverted.
Fixed a visual bug in the profile where the Ban button rendered in a glitchy way.
Added support for hidden fields to the JS Framework for inline editing rows.
Fixed a bug with the like counter rendering on-top of the alert list.
Atom's stripping trailing tabs for some reason, so don't be confused if there are a bunch of weird changes.
2017-06-05 12:57:27 +01:00
Azareal 9b1489b90f Happy 100th commit! For the 100th commit, I've revamped a good portion of the user interface, and we don't plan on stopping! There's more to come!
Each theme has more of a distinct feel in the control panel now. I moved a large portion of the inline CSS into global.css, tweaked some core code which didn't line up, and added CSS text insertions to make things more flexible.

Revamped the alerts interface. We have more changes coming up!
Added screenshots for Tempra Cursive and Tempra Conflux Mobile to the README.
Added a .htaccess file, just in case someone plops Gosora in Apache's /www/ folder to stop the contents of config.go from becoming publically visible. Never put Gosora in your /www/ folder, Gosora is a standalone program which does NOT use Apache or any other webserver.
Fixed a bug in the inline forum editor.
Added a hand-written Markdown parser which is much faster than the previous Regex based one. This is still a work in progress.
Added support for strikethrough and underline elements to the Markdown parser.
Fixed the missing semicolons in global.js
Revamped the form CSS.
Author bits on the theme manager now link to the author's website.
Improved the profiles a little.
The code in the stylesheets now have a more consistent style.
Fixed a bug in the Cosmo theme relating to the fact that Gosora doesn't have sidebars yet.

There are many more changes which aren't listed here.
If weirdness regarding lines or spacing occurs, I'm experimenting with a new text editor. I hope to have this fixed by the next commit.
2017-05-29 15:52:37 +01:00
Azareal b60792391e Improved the mobile theme for Tempra Mobile. I broke something in the process of doing so, but it shouldn't take too long to make right!
Action posts are now visible on Tempra Conflux, Cosmo, and Cosmo Conflux.
Action posts now work properly on mobile.
2017-05-13 15:27:42 +01:00
Azareal b841acef29 Revamped the top navbar.
Really large numbers are now formatted properly on the Control Panel Dashboard.
2017-05-12 14:25:12 +01:00