bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

forum underconstruction page

(10 posts)
  • Started 12 months ago by Null
  • Latest reply from livibetter
  • This topic is not resolved
  1. 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 12 months ago #
  2. There is a plugin for WordPress but I haven't seen one for bbPress.

    Posted 12 months ago #
  3. Thanks, gonna take a look at it. Perhaps it's easy to convert :)

    Posted 12 months ago #
  4. 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 12 months ago #
  5. 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 12 months ago #
  6. 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 12 months ago #
  7. 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 11 months ago #
  8. Doesn't every template/theme header call bb_head();? So then you could write a plugin that calls something like add_action('bb_head', 'blah_maintenance_mode'); right? I think the header supplied should be a 503 header('HTTP/1.0 503 Service Unavailable');

    One of these days I'll learn how to write a plugin :D

    Posted 11 months ago #
  9. Thx chris I'll try that

    Posted 11 months ago #
  10. Just a note, if you want to send a http response code, you need to use bb_init action (check init action for WP). If you use bb_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_template and then exit in the action hook.

    Posted 11 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.