It’s that time again, time for another MyBB 2.0 dev blog! This post is the fifth in a series of development update posts regarding MyBB 2.0. Currently in pre-alpha, MyBB 2.0 is the long awaited upcoming major version of the open source MyBB forum software. We’ll be posting regular updates (we promise!) in regards to the development to keep you all updated. The development team have been hard at work since our last dev post, adding new features and polishing existing functionality. This post will explore some of these new features and highlight our approach to the development of the system.
Note that all screenshots and details contained within these posts are subject to change and is taken from early developmental software; details are in no way indicative of the features or presentation of the final software.
Request for feedback regarding the attachment system in 2.0
This month we created a topic asking for feedback regarding the new attachment system in 2.0, which can be found here.
This thread is the first of hopefully many as we try to promote community input into the future of MyBB. We’ve been trying to be more open for a while now and this is the next step in that evolution. All feedback is encouraged and gratefully received, though we do ask that users check if their suggestion has already been posted rather than repeating suggestions. If somebody has already posted a suggestion and you wish to just note your agreement, please simply quote the original suggestion and state your agreement.
We will be using this system to announce any new features we’re working on or at least considering before we start implementation, allowing us to run our ideas past the community. Before creating a thread, the staff will have already agreed on a basic set of features that we both want and definitely do not want (for example, with the attachment system, we have agreed as a staff team that we definitely do not want a gallery system).
Enhancing organisation of the 2.0 forum
As part of our ongoing restructuring and reorganisation, we’re going to start writing new threads within the MyBB 2.0 Implemented Features forum. This will be an ongoing effort which I should be making a start to this week. This will make it easier for users to comment upon and provide feedback to features we’ve already announced and/or shown within these development posts.
How we code 2.0: Code style
As we have been doing in recent posts, I’d like to take a chance to look at the coding standards that we’re following to write MyBB 2.0.
For 2.0, we’re following the PSR–4 autoloader specification for how we structure the physical lay out of our classes within files. Basically, it boils down to the following (class is shown on the left, the resolved path is shown to the right):
MyBB\Core\Database\Models\User — ./app/Database/Models/User.php MyBB\Core\Http\Controllers\UserController — ./app/Http/Controllers/UserController.php
As you can see, this specification leads to a very clear layout and organisation of code rather than the MyBB 1.x approach of just putting every file inside
In terms of the actual code format, we’re basically following the PSR–2 standard, though we are using tabs rather than spaces. We know that the issue of tabs vs. spaces is rather divisive, so we’d rather not get into any arguments here but our basic reasoning is that we’d rather not waste 4 characters where one character suffices. Additionally, most modern code editors can handle either tabs or spaces as pretty much the same.
In order to aid in the following of these standards, Jones has created a set of rules that can be used with PHP CodeSniffer. These rules are ran automatically by Circle CI (see Dev Post #4 for more information on how we use Circle CI to provide continuous integration!) to make sure that all code committed to our Git repositories follows the same standards. This leads to the MyBB 2.0 codebase having a very clear and readable codebase that’s cohesive throughout.
Obviously, we will not force these code standards on plugin authors and such, but everybody contributing to the core will be expected to follow them (and will in fact be forced to by CircleCI).
New feature: collapsing single posts
MyBB 2.0 has now picked up the ability to be able to collapse posts out of view. In the future, we will be adding the option to automatically collapse posts created by certain users (as an enhancement upon the current user ignore system found in MyBB 1.x). This allows users to automatically hide content from other users that they find distracting but optionally expand them if they wish to.
Each post can be collapsed and expanded using a simple toggle switch found at the top right of every post. Users who use Reddit may find this feature rather familiar.
The moderation system is receiving a major overhaul for MyBB 2.0 thanks to a lot of work done by Will. The new system allows plugin developers and integrators to easily add both new and existing moderation tools to their new content types and to add entirely new moderation tools by simply writing a class or implementing a PHP Trait. This makes the moderation system far more flexible than it previously has been.
A few screenshots of this new moderation system are below, showcasing multiple post selection, the new inline modification toolbar that follows your navigation throughout the page and the moving of a topic to another forum.
In MyBB 2.0, it is now possible to automatically crop and position your avatar after uploading it rather than having to edit your images in some specialised desktop software. This is an extremely useful feature that can lead to much nicer looking avatars for everyone.
Additionally, avatars can be uploaded by simply dragging and dropping an image onto any place on the screen that your avatar is shown. Doing so will automatically upload the image and present the crop screen to the user.
Minimum PHP version announcement
Since the release of Laravel 5.1, which is a long term support (LTS) release, the minimum PHP version required for MyBB 2.0 has been updated to PHP 5.5.9, which is required as it fixes several bugs found in previous PHP releases. Laravel 5.1 is guaranteed bug fixes for 2 years and security issues for 3 years, allowing peace of mind and stability for the project.
As part of this change, we’ve started to compile a list of hosts which support PHP 5.5.9 or later out of the box. Given the forthcoming End Of Life of PHP 5.4 (September 14) major providers are expected to begin the natural process of making higher versions (PHP 5.5 or 5.6) available or preset by default, which is why we’d love to receive community input on keeping it up to date. In order to facilitate this effort, we’ve created a new repository on our GitHub account that we are asking the community to contribute to so that we have a list of hosts that we know will support MyBB 2.0 ready for release.
Looking to the future
These development posts haven’t exactly been following a strict schedule recently and I can only apologise for this. We’re going to be trying to commit to a more regular update schedule going forward.