Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Forum Messages

Hello-

Is there a way of hiding Forum Messages from non-signed-in viewers? Everything else seems to be hidden from the public, but the Messages show up on the login page as well. Thanks!

Comments

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Use the plugin force redirect and edit the controller/page from the array you wish to keep private. If you only want the login page to show then remove all but the register controller.

  • Options
    peregrineperegrine MVP
    edited June 2013

    in the dashboard - go to the guest role (non-signed in users) and remove the view permissions for whatever you want to prevent viewing on.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    @vrijvlinder can you be a little more specific on which file I need to edit? I'm not sure where the "controller/page" is located to edit.

    @peregrine I've done this, but the Messages still show on the login page, unless I place them below the sidebar. I'm wanting them "Above Main Content", but only when a user is logged in.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes download and install forceredirect plugin , then open the default.php find this part

    // Get the controller name
     $Controller = $Sender->ControllerName;
    $ShowOnController = array('discussioncontroller','discussionscontroller','categoriescontroller','plugincontroller','entrycontroller','activitycontroller');
    
    

    those are the controllers aka pages remove all but the entry controller from the list that will force anyone to the login.

  • Options

    @peregrine, in looking back over the settings, the Guest role does not have an option for Messages. Am I missing something?

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    The guest role should have no permissions except view discussions and profile .

    But from what I have found this does not always work that is why the force redirect plugin is useful .

  • Options

    @vrijvlinder thank you! I'll dig into it.

  • Options

    @vrijvlinder, it doesn't seem to help. You can see the two messages here: http://www.theleadbox.com/

    This is what those three lines of code you gave me look like in my plugin now:

    // Get the controller name
     $Controller = $Sender->ControllerName;
    $ShowOnController = array('entrycontroller');
    
  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited June 2013

    ok you can hide those using css then , just stick this code in the custom.css of the theme

    
    body.Dashboard.Entry .DismissMessage.Info,body.Dashboard.Entry .DismissMessage.Warning ,body.Dashboard.Entry .Info,body.Dashboard.Entry  .Warning{
    display:none!important;
    }
    
  • Options

    @vrijvlinder OK, thanks I'll give that a shot.

  • Options

    @vrijvlinder, thank you that worked perfectly!

  • Options

    I'm running Vanilla 2.1.7 and am struggling with hiding the site messages on the login page. Any insight would be much appreciated.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    You would have to either create a plugin or a custom theme with a themehooks file (if you are not already using a theme with a themehooks file.

    There you would need something like:

    public function base_render_before ($Sender) {
        if (!Gdn::Session()->IsValid()) {
            unset($Sender->Assets['Head']['MessageModule']);
        }
    }
    
Sign In or Register to comment.