|
1 | 1 |  |
2 | 2 | # post-local-storage |
| 3 | +## Locally store the content of a post in the phpBB forum software |
3 | 4 |
|
4 | | -A very simple phpBB3 extension to locally store the content of a post being written, to avoid losing everything after a crash or session expiration. |
| 5 | +A very simple [phpBB3](https://www.phpbb.com/) extension to use the browser's local storage for preventing the content of a post to be lost after a crash or session expiration. |
| 6 | + |
| 7 | +## Reasoning |
| 8 | + |
| 9 | +You know how it is. You've taken four hours to write your latest masterpiece to show off to the world on a phpBB forum. You press <kbd>Submit</kbd> and... well, your session had expired, so _everything is lost_. Irretrievably so. Pressing 'back' on the browser will not help. What to do?... well, nothing, really. |
| 10 | + |
| 11 | +You're used to WYSIWYG editors, where such things _never_ happen in the 2020s, so naturally enough you didn't save a copy _before_ you posted the article. But, alas, there is no official WYSIWYG editor in phpBB, for various reasons. |
| 12 | + |
| 13 | +Why, oh why, didn't phpBB save your data? |
| 14 | + |
| 15 | +Well, there is the 'Draft' facility, but that doesn't work as well as it should. Unless you have an extension for that, by default, forum users have to _manually_ press <kbd>Save Draft</kbd> — and it will mean that some things (such as attachments) will be lost anyway. Drafts are also stored on the phpBB database, on the backend, so if something goes wrong with your connection and/or the database connection... you'll lose your draft as well. |
| 16 | + |
| 17 | +This extension tries to replicate the most basic solution to the above issues. It uses your browser's local storage facility, which can be accessed using JavaScript. Although details differ between browsers, in general, each will persist the data across crashes. It should also be able to deal with most issues of lost typed content on posts as well as on Private Messages (PMs). However, the current version will not be able to |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +If you're reading this on GitHub, then all you need is to either download the last package (on the left) and unzip it to the `ext` directory under the root of your phpBB3 installation. |
| 22 | + |
| 23 | +Alternatively, you can always grab the latest version with `git clone https://github.com/GwynethLlewelyn/post-local-storage`. The plugin itself is inside `gwynethllewelyn/postlocalstorage`. These are the files to upload to your phpBB installation (you'll probably need to create all directories first, e.g. under `ext`, create `gwynethllewelyn/postlocalstorage`). |
| 24 | + |
| 25 | +Then go to the **ACP** > **Extensions**, on the sidebar: **Extension Management** | **Manage extensions** and activate **Locally store the content of a post**. |
| 26 | + |
| 27 | +There is no further configuration required. |
| 28 | + |
| 29 | +## Acknowledgements |
| 30 | + |
| 31 | +Many thanks to |
| 32 | +[@Tread](https://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1973496) and [@cabot](https://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1337922) for gently 'persuading' me to publish this code as a phpBB3.3 extension, by pointing me to all the appropriate bits and pieces of code to be 'assembled' into an extension. Yay! |
5 | 33 |
|
6 | 34 | Logo designed by [DALL·E 2](https://openai.com/product/dall-e-2). |
7 | 35 |
|
|
0 commit comments