[CDB] Post Local Storage

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
Gwyneth Llewelyn
Registered User
Posts: 60
Joined: Thu Aug 06, 2009 11:34 pm
Location: Neufreistadt, Confederation of the Democratic Simulators, Second Life
Name: Gwyneth Llewelyn

[CDB] Post Local Storage

Post by Gwyneth Llewelyn »

post-local-storage-logo-smaller.png
Extension Name: Post Local Storage
Author: Gwyneth Llewelyn

Extension Description: 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.

I do apologise in advance if I did anything wrong; this is my first phpBB3 plugin ever, and I'm neither a professional programmer (just a well-intended amateur with a solid CV in programming theory!), nor familiar enough with the internal workings of phpBB3 (especially in the way extensions are handled). I've just grabbed some code posted by some benevolent users, cleaned it up, combined it into something extension-like, and submitted it for discussion :)

Extension Version: 1.0.2

Requirements: So far, only tested with phpBB 3.3.10, running under PHP 8.2.3, with the prosilver template.

Features:
  • This extension just adds a snippet of JavaScript to the footer of the current template, which triggers the automatic mechanism for saving to the browser's local storage.
  • Because most contemporary browsers have a way to keep local storage persistent, this means that the content will not be lost, when a tab/browser is closed accidentally, the page refreshed by mistake, the session having expired, or simply a crash (requiring a reboot!). Actual management of these features is fully done by the browser (not the extension!) and may vary between browsers/operating systems.
  • Storage is held per page, i.e. you can work on several different open pages in the same forum (like when replying to several threads simultaneously), and each will have its content stored independently of each other.
  • Nothing is saved remotely (unlike drafts!), which means that no database changes whatsoever are required: everything is managed locally.
  • When submitting a post, the stored content is wiped clean from local storage (but see notes below).
  • Requires JavaScript to be enabled on the browser — as well as having local storage! — which means that you should be using a contemporary, graphical browser.
  • Zero configuration!
Screenshots: None, since nothing is installed on the ACP, MCP, UCP, or, indeed, anywhere visible :-)

Demo URL: Sorry, none.
Demo Username: N/A
Demo Password: N/A

Extension Download: Direct download from GitHub: https://github.com/GwynethLlewelyn/post ... torage.zip

Notes
  • 1.0.2 seems to sometimes 'forget' to clean the local storage after a post is submitted. This is one of those very-hard-to-trace bugs lurking in the code somewhere. Thanks to @HiFiKabin for having spotted that bug!
  • Error reporting can be here, or you can open an issue on GitHub, if you prefer.
You do not have the required permissions to view the files attached to this post.
I'm just a virtual girl in a virtual world...
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6717
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James

Re: [3.3][DEV] Post Local Storage

Post by HiFiKabin »

Great idea, subscribing (as you already know)
Tread
Registered User
Posts: 102
Joined: Thu Nov 14, 2019 9:52 pm

Re: [3.3][DEV] Post Local Storage

Post by Tread »

If you want the code for quick reply and a better code for mchat just shout ;)
User avatar
Gwyneth Llewelyn
Registered User
Posts: 60
Joined: Thu Aug 06, 2009 11:34 pm
Location: Neufreistadt, Confederation of the Democratic Simulators, Second Life
Name: Gwyneth Llewelyn

Re: [3.3][DEV] Post Local Storage

Post by Gwyneth Llewelyn »

Thanks @Tread — I certainly won't forget that offer ;-)
I'm just a virtual girl in a virtual world...
MalikTH
Registered User
Posts: 15
Joined: Fri Sep 16, 2022 11:46 am

Re: [3.3][DEV] Post Local Storage

Post by MalikTH »

I've had this installed on my board for some time now and it doesn't seem to be working for my users, as they're still losing posts. I'm updating from v1.0.2 to v1.0.3 now, but that seems to be more of a polishing update and I doubt it will solve the issue.

EDIT: There were issues with how my cookie settings were configured. All is well now.
SeewolfPK
Registered User
Posts: 109
Joined: Sat Apr 09, 2011 10:18 am

Re: [3.3][DEV] Post Local Storage

Post by SeewolfPK »

When will this nice EXT go working also in quick reply?
Best wishes
Paul
MxAlex
Registered User
Posts: 14
Joined: Fri Apr 03, 2020 5:03 am

Re: [3.3][DEV] Post Local Storage

Post by MxAlex »

This ext is a lifesaver!! I noticed it didn't save the title for a new topic I tested it on, but the fact that it saved the body of the post was awesome. Great work. :)
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6717
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James

Re: [CDB] Post Local Storage

Post by HiFiKabin »

Released to the CDB

Return to “Extensions in Development”