Info
- 10 posts
- 4 voices
- Started 4 years ago by Null
- Latest reply from livibetter
- This topic is not resolved
forum underconstruction page
-
- Posted 4 years ago #
Hi,
I thought there already was a plugin for this, but I can't find it.
What I am looking for is a way so the admin can put the forum in undercontruction-mode. Visitors will see a default underconstruction-page until the admin removes it again (with a selection option in the admin?). Very handy when updating a forum.
_Null
-
- Posted 4 years ago #
There is a plugin for WordPress but I haven't seen one for bbPress.
-
- Posted 4 years ago #
Thanks, gonna take a look at it. Perhaps it's easy to convert :)
-
- Posted 4 years ago #
I hope so. I typically use .htaccess to change the DirectoryIndex if I'm working on the forum, but that doesn't prevent anyone from accessing the site from search engines or bookmarks with direct URLs. It just prevents access from the home page. It would be better to have a maintenance mode.
-
- Posted 4 years ago #
I was thinking of a check in the header, since this is always loaded. If maintenance is true -> load maintenance page, else load forum. Very simple to do (if there is an hook in the header.php) . I'll try to cook something up :)
_Null
-
- Posted 4 years ago #
Use a php call in the header that checks for a value (for construction) and if it does, serve up a static .html page would be the easiest. If you could create a plugin that just has a "checkbox" in the admin area and then a call to find out that option in the header.php that should work in theory right?
Trent
-
- Posted 4 years ago #
Yeah just my thoughts too, but playing with this, I think the header is not to right way to go because it only excists as a template file and there are no hooks for it. So if you would use this this way, you should modify every header.php in every template you have.
Not a fun job to do if you have many and I believe a plugin should work with most templates and with many or non modification to any file. So I am looking at another file at the moment to see if it would work with that file too.
_Null
-
- Posted 4 years ago #
Doesn't every template/theme header call
bb_head();? So then you could write a plugin that calls something likeadd_action('bb_head', 'blah_maintenance_mode');right? I think the header supplied should be a 503header('HTTP/1.0 503 Service Unavailable');One of these days I'll learn how to write a plugin :D
-
- Posted 4 years ago #
Thx chris I'll try that
-
- Posted 4 years ago #
Just a note, if you want to send a http response code, you need to use
bb_initaction (check init action for WP). If you usebb_head, you will get error since there is something has been sent to client side before your own header. And your own response code won't be effective.I suggest you send header,
bb_load_templateand thenexitin the action hook. -
You must log in to post.