1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

moderators can access board when it's not active like admins

Discussion in 'Code Modifications [Archive]' started by Mutt, Jan 3, 2012.

  1. Mutt

    Mutt Well-Known Member

    this is a minor hack but since I couldn't find it anywhere, here it is. I wanted the moderators to be able to access the site when I have it off too.

    in \library\XenForo\ControllerPublic\Abstract.php
    change line #107 from
            if (!$options->boardActive && !XenForo_Visitor::getInstance()->get('is_admin'))
            if (!$options->boardActive && !XenForo_Visitor::getInstance()->get('is_admin') && !XenForo_Visitor::getInstance()->get('is_moderator'))
    I also edited the phrase "forum_is_currently_closed_only_admins_may_access" to change the word Administrators to Staff for the closed message but that's not really necessary.


    I considered adding a ACP option to toggle where or not the mods could get in when the board was closed but then decided I was going overboard.
    Liam23, Dan, Ranger375 and 2 others like this.
  2. Mutt

    Mutt Well-Known Member

    I'm getting ready to upgrade to 1.12 & realized I don't want the staff on the board for this. Here's a small edit that allows you to decide via the ACP.

    you need to be in debug mode to edit ACP options

    go to ACP / Options / Board Active

    click "Add Option" and fill out the form as follows
    Option ID: boardInactiveAllowStaff
    Add-on: Xenforo ( no, i didn't make an addon name for this. I'm not sure if it's bad form to do this but whatever )
    Title: Allow moderators when inactive
    Explanation: Moderators can still browse board while it is inactive / closed
    Edit Format: On/Off Check Box
    Data Type: Boolean
    Default Value: 0 ( that's a zero )

    and the edit from the previous post would now be

            if (!$options->boardActive && !XenForo_Visitor::getInstance()->get('is_admin') && !(XenForo_Visitor::getInstance()->get('is_moderator') AND $options->boardInactiveAllowStaff))
    now the mods can only browse if I check the "allow mods" box.

    I checked & the line is still #107 in v1.1.2

    Attached Files:

    Liam23 likes this.

Share This Page