You might be able to disable the appropriate database writes at the data access layer without changing much.Also a true "read-only" mode would need to disable ALL database updating which would mean disabling all sorts of stuff, not just post creation..
Except for admins, right?The alternative is to just disable logging in when the forum is in read-only mode, this way threads won't be marked because the user isn't logged in.
I'm sure it wouldn't be as hard as I anticipate it to be (as in rewriting the whole user-input). Perhaps there could be a block issued just before the data is inserted that states "The forum is in read-only mode, no changes can be made to your account."Also a true "read-only" mode would need to disable ALL database updating which would mean disabling all sorts of stuff, not just post creation...but editing user accounts, profile, updating user status, private messaging, all modifications (chat, gallery, blog), registrations, login attempts...yikes, the more I think about it, the longer this rabbit hole gets.[...]
If we choose which usergroups can view, if these users were to browse as normal then thread marking would still need to be in effect.How about an admin option to choose which usergroups can use the read-only feature... like enabling read-only mode for guests which also includes SE crawlers... this will also resolve thread markings issue as forums would closed for members anyway...
Personally, I believe users would not mind about those aspects, especially if they are looking for some information on your site and they see a message like "Board open in 1 hour", instead of the actual information. After all, it will be an option and you decide if you want it enabled or not.I like the idea, but I think it would cause some issues I don't want to deal with every single time I shut the board down, and Ryan brought up some valid points as well.
Keep a mirror copy of the board, and there do all upgrading, re-customizing of templates, checking mod compat, etc. Once the test board has been upgraded and tweaked into submission, upgrading the live board and migrating the customizations over is a short & sweet adventure....Another very obvious problem with read only mode is the simple fact that major upgrades/migrations often break lots of things - and you don't want your users to experience this, hence closing the forums completely.
So, could temporarily moving all non-admins to the 'guest/not logged in' group achieve your goal?Here is an idea. Make the forums readable only for guests and let the users know.
Still, this could be used for cases like permission changes, forum overhauling, things that aren't direct database work.If you're doing database or code changes, simply executing the files and reading from the database could be broken at certain points. I would rather just shut down my forum completely.![]()
Doesn't the BBC do this? Have 'hours they are open'? cannot quite remember.I like it!!!
Some Corporate or special boards which require staff to be active when members are posting would also use this feature, the board could be shut down for the night, and still allow it to be read.
Doesn't the BBC do this? Have 'hours they are open'? cannot quite remember.
The idea to use cookies for storing changes to the user account (i.e. read posts, etc.) and then entering them into the database isn't really a good idea. This could lead to either hacker attempts using the cookies when board comes out of read-only mode, or if hackers manage to get their hands on the cookies of users they can use it to track them, etc, etc. and obviously the cookie might be storing personal data so that you can verify the cookie. I could go on with different scenarios that could, and might, happen but I'll just leave it at that.Just to throw my other idea out there, we could store changes made to a cookie instead of storing in the database then grab the cookie and insert the cookie into the database when read-only mode is disabled
That could open the door to MySQL injections, no?Just to throw my other idea out there, we could store changes made to a cookie instead of storing in the database then grab the cookie and insert the cookie into the database when read-only mode is disabled.
Well, the idea is to stop all writes to database, so you can create a reliable backup. If you allow the group of admins to browse the forums, you will not gain anything enabling the option since your allowed users will perform writes to tables, based on their activity. That is why I suggested to allow only guests viewing the forum content. It will still require to have the number of users online disabled, etc.How about an admin option to choose which usergroups can use the read-only feature... like enabling read-only mode for guests which also includes SE crawlers... this will also resolve thread markings issue as forums would closed for members anyway...
Not if it's properly sanitized. I still don't like the idea, though.That could open the door to MySQL injections, no?![]()
Floren?So, could temporarily moving all non-admins to the 'guest/not logged in' group achieve your goal?
Maybe a switch/option that does that?
MySQLi prepared queries would fix that problemThat could open the door to MySQL injections, no?![]()
We use essential cookies to make this site work, and optional cookies to enhance your experience.