Best Of
Corona-Pandemic - Free plugins for social communities
Hi all,
We from VanillaSkins.com would like to give out our paid plugins to communities who are dealing with topics that are relevant for social stability.
The current corona pandemic is spreading rapidly in Europe. It already affects major industries and not only airports and local shops are ordered to shut down, also critical infrastructure like hospitals and organizations experience disorders. Reports are coming in that internet infrastructure like MS teams, Zoom or Discord are down repeatedly.
Due to the fact that forums like Vanillaforums OS are silos of experience and opinions and can relatively easily be setup on smaller infrastructure, we are offering our paid plugins for free to communities that are directly connected to important parts of our lives and society.
So if you run a community on psychological health, or you manage a forum of an NGO dealing with climate change, a forum on teaching children who can't go to school or you are a part of farmers collective exchanging growth cycles of crops... please contact me if any of our plugins would provide help to your community.
This shall not be empty words seen as a marketing opportunity. Problems surrounding the corona virus got pretty real in the last days events in Europe. I myself manage multiple pregnancy and birth communities and expecting mothers are afraid to go to the hospitals, fathers are not let into delivery rooms and birth clinics are closing. As mothers are asking for home birth opportunities we currently connect midwifes specialized in that field with them. So probably there is an opportunity for your community to help in this situation too. Think about it.
Best regards and keep save,
phreak

Running vanilla from docker in production
I've been using Vanilla for about 5 years, and have developed a maintenance process along the way that has broken down. My goal was to version control our setup (customisations, theme, plugins), and allow for automated deployments like the rest of our stack. I did this by forking the repo and adding to it: for plugins that were on GitHub, I added them as submodules; when they weren't on GitHub, I added their contents to our repo.
This worked for the most part, but upgrading the forums was always a bit of a pain, as we had to rebase and deal with any merge conflicts. We now have a huge number of merge conflicts, to the point that I'd like to start over and make a better setup.
The goal is to create a version controlled forum setup, with reproducible builds, that can run on an ephemeral filesystem (even heroku) so we can load balance it and even blow it away and reconstruct it if necessary. The twelve-factor app provides some background and general principles for this.
To do this, I figure I'll need to:
- Start from a specific Vanilla release: either a distributed package (zip) or the GitHub codebase (in which case I'd need to run composer).
- Fill in
config.php
with settings and secrets, without putting secrets into version control. - Pull in our theme, either from a separate git repo or from a directory within this repo, and move it to the
themes
directory of the Vanilla codebase. - Do the same for 10+ plugins, some of which are on GitHub, others which are just .zip files on the addons website.
- Set
conf
,cache
, anduploads
to be writable by PHP. - Somehow make
uploads
a separate volume (like S3) so it can be shared across multiple instances and can persist (even be backed up).
I've started implementing this in a Dockerfile. You can see my progress so far at this repo.
Where I need help
1. config.php
I'm having some trouble with config.php
because Vanilla writes to it when an admin makes a change in the admin dashboard: it replaces getenv(...)
with the plaintext value. Therefore, if you want to commit any changes made in the dashboard back to source control (say, by mounting config.php
as a volume and then making the changes), you'd be committing secrets unless you remember to go back in and change them back to getenv
. Solutions to this I've thought of so far are: (a) make it read-only, so the application cannot change it, or (b) consider it a secrets file, outside of source control. But then how would you do an automated deployment? Is there a way to stop Vanilla from writing to config.php
? I would think the database would be better suited for some of these settings, no?
2. Pulling in the theme and plugins
The simplest approach here is for the Dockerfile to just curl and unzip the theme and plugins. I can either put them in the appropriate place in the Vanilla codebase, or symlink them; it doesn't make much difference, I don't think. But it starts to feel like the job of a dependency manager. I could use composer here, but I'd have to either move the installed directory or symlink it to the appropriate place, and I don't think composer can do that, can it? Does anything else come to mind here?
Let me know if there's been any prior work on this, or if anyone wants to collaborate. I'm sure there's ways we can make the repo generic.
Re: Upgrade to 3.2 from version 2.1
Just do it 😉
Start with a backup: zip your complete Vanilla folder and make a backup of your database. Nothing can really go wrong after that!
Read the documentation page:
Normally an upgrade can be done by just copying over the new files. In this case, you additionally need to delete files and folders. Which files and folders to delete can be found in the link above.
Some old plugins do not work with the current version. Therefore the first step (after the backup) I would make would be to disable all plugins and applications (with exception for the vanilla and the conversations application and the HTMLawed plugin). After your update you should re-enable all those plugins one by one and test if they still work before you enable the next plugin.
But again: simply do it. Inform your users about 2 hours of downtime and your safe. In that time you either have finished upgrade (although it should be possible to upgrade in minutes) or you have found there are problems that would require further investigation and you need to restore the forum from the backup.
If you face the "Something has gone wrong" error message, please take a look at the docs on how to get more information, so when you really have to ask for help, you could tell us what the problem has been.

Re: How to implement a Pager
There is no tutorial on that and the pager is quite complex, thow you do not need to do much to get it going. After you have set up a working pager, I recommend taking a closer look at the class.pagermodule.php to find out more about its possibilities.
The best way to get going is to look at a page where you can find a pager, e.g. one of the discussions lists (recent discussions, bookmarked, mine etc.) You can find that code in /applications/vanilla/controllers/class.discussionscontroller.php
Let's look at the mine() method, which is quite short, but I stripped out what is not necessary to get a working example:
public function mine($page = 'p1') { ... // Set criteria & get discussions data list($offset, $limit) = offsetLimit($page, c('Vanilla.Discussions.PerPage', 30)); ... $countDiscussions = $this->setData('CountDiscussions', $discussionModel->getCount($wheres)); ... // Build a pager $pagerFactory = new Gdn_PagerFactory(); $this->EventArguments['PagerType'] = 'MorePager'; ... $this->Pager = $pagerFactory->getPager($this->EventArguments['PagerType'], $this); $this->Pager->MoreCode = 'More Discussions'; $this->Pager->LessCode = 'Newer Discussions'; $this->Pager->ClientID = 'Pager'; $this->Pager->configure( $offset, $limit, $countDiscussions, 'discussions/mine/%1$s' ); $this->setData('_PagerUrl', 'discussions/mine/{Page}'); $this->setData('_Page', $page); $this->setData('_Limit', $limit); ... // Deliver JSON data if necessary if ($this->_DeliveryType != DELIVERY_TYPE_ALL) { $this->setJson('LessRow', $this->Pager->toString('less')); $this->setJson('MoreRow', $this->Pager->toString('more')); $this->View = 'discussions'; } ... }
The main element in there is the following block:
$this->Pager->configure( $offset, $limit, $countDiscussions, 'discussions/mine/%1$s' );
The pager module needs to be configured with those information: where does the current page starts (offset), how much elements does it show (limit), how much elements are there in total (countDiscussions) and where should the previous and next page links should point to.
But look at method code step by step:
public function mine($page = 'p1') {
In your plugin this will most probably be
public function pluginController_foo_create($sender, $args) {
The $args array will contain everything that comes after yourforum.com/plugin/foo/...
Therefore, if your url scheme for e.g. the third page should be /plugin/foo/p3, you should have the following code for getting the page for building the pager: $page = $args[0] ?? 'p1';
If your url scheme is /plugin/foo/bar/baz/p3, the required code would be $page = $args[2] ?? 'p1';
list($offset, $limit) = offsetLimit($page, c('Vanilla.Discussions.PerPage', 30));
This line does a lot! You should look up the function offsetLimit
in functions.general.php. What's happening here is that the variables $offset and $limit are filled based on the $page variable and the config value for Vanilla.Discussions.PerPage. I would encoure to make your view configurable in the same way.
list($offset, $limit) = offsetLimit($page, Gdn::config('Plugins.FooBar.PerPage', 30));
And if it makes sense, you can directly use a Vanilla PerPage setting as default!
list($offset, $limit) = offsetLimit( $page, Gdn::config( 'Plugins.FooBar.PerPage', Gdn::config( 'Vanilla.Discussions.PerPage', 30 ) ) );
The following lines in the snippet are split because that way a plugin author can influence the look and feel of the pager of the mine() method.
$this->EventArguments['PagerType'] = 'MorePager'; ... $this->Pager = $pagerFactory->getPager($this->EventArguments['PagerType'], $this);
You can condense it to this line
$this->Pager = $pagerFactory->getPager('MorePager', $this);
By the way: in most cases when you look at Vanilla code and see $this
, you will have to replace that with $sender
(if you stick to Vanillas conventions)
Frankly spoken, I'm not sure if you need this block:
$this->setData('_PagerUrl', 'discussions/mine/{Page}'); $this->setData('_Page', $page); $this->setData('_Limit', $limit);
ANd you have to decide by yourself if that makes sense for you:
// Deliver JSON data if necessary if ($this->_DeliveryType != DELIVERY_TYPE_ALL) { $this->setJson('LessRow', $this->Pager->toString('less')); $this->setJson('MoreRow', $this->Pager->toString('more')); $this->View = 'discussions'; }
In your view, a simple PagerModule::write() should be sufficient.

Re: How to install Indonesan Language for vanilla 3.1 self hosting?
You can find it here
How to

Vanilla 3.1 is now available
Missed the 3.0 release? Check out the upgrade & release notes here.
Hi everyone! The team has been hard at work over the last month fixing bugs and security holes and even squeezing in a new feature. There should be no breaking changes in this release so it should be a very straightforward update.
Upgrade Notes
- Vanilla 3.x requires PHP 7.1 which is a change from earlier versions. We strongly recommend upgrading to PHP 7.3 as soon as possible. Many hosting plans allow a seamless transition via their control panel.
- Follow the normal upgrade process, including running /utility/update.
- Follow additional specific upgrade instructions.
- Test your plugin & theme compatibility in a safe place before upgrading your production forum.
Download
Get over in the addon directory. https://open.vanillaforums.com/addon/vanilla-core-3.1

Re: Passwords no longer work after update from 2.2
The category is closed for a reason: the version of Vanilla you are using has security issues. Any question concerning a Vanilla version prior to 3.0.2 (currently) can be answered with: "Update!"
Simple as that.

Re: How to install a plugin/addon/theme
You can download a theme from here and it will be a zip file.
It can be best explained by using a name, e.g. Groovy
.
The file needs to be unzipped to your /themes
folder. While normally simple unzipping is enough, you can check the following three things to be sure that the unzipping was correct:
- There is a folder
/themes/Groovy
- In this folder is a file
about.php
oraddon.json
=>/themes/Groovy/about.php
. If both files exist, the addon.json is the important file! - In the about.php there is the line
$ThemeInfo['Groovy'] =...
or if there is a file addon.json, you need to find a line like"key": "Groovy",
The folder must be named exactly like the text you find in addon.json or about.php: "Groovy". If your zip file has been extracted to "Groovy", but in the addon.json/about.php you see it is spelled all lower case "groovy", you have to rename the folder.
If you cannot see the theme in the dasboard, delete /cache/theme-index.php
and if there is a file /cache/theme/groovy.php
or /cache/theme/Groovy.php
, which is not probable, delete that, too

Vanilla 2.8.4 is now available for download - Important security patches
Get it right here: https://open.vanillaforums.com/addon/vanilla-core-2.8.4
This release contains CRITICAL security patches.
- Patched SSRF in HTTP client.
- Updated release file system permissions to be less permissive.
It has been brought to our attention that our file system permissions were far to open in our open source releases. These concerns were initially dismissed because in our version control repository and on all of our infrastructure the permissions were correct.
Thanks to the insistence of @R_J I discovered a bug in our OSS release build tool that reset all of the file permissions to 777 (very dangerous).
Starting in this release file system permissions are essentially 755 for directories and 644 for files.
Please upgrade to the latest version of Vanilla as soon as possible. No other changes from 2.8.3 are in this version.

Re: Migration
Just try it! There is a porter script: https://open.vanillaforums.com/addon/porter-core
Run the porter script on your server, install a clean Vanilla version on your desktop pc, import that old forum and see if all the features you need are available.
Each forum software has a lot of features and you will find out that migrating from one forum to another always will bring some benefits but some other features are worse. Therefore I think it is necessary to test around a little bit.
