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

Settings Page Vanilla 2.1

This discussion is related to the OnlineNow addon.
woftwoft
edited May 2014 in Vanilla 2.0 - 2.8

Hello,

Another question for the Vanilla Forum Guru's.

@vrijvlinder‌ i'll tag you because you know, you built this version :smile:

So... on the profile edit page, you have the 'PanelInfo' box, instead of the 'MeBox'. This is fine until I go to the 'Online Settings' Page. The PanelInfo box dissapears. How do I retain this box on the 'Online Settings' Page?
Additionally, the breadcrumb trail no longer says that it is in the profile section, but instead simply says 'Home'. I understand this may be because the 'View' for the 'Online Settings' page is located within the plugin folder, is this also the reason the 'PanelInfo Box' dissapears?

I have photo's for a clearer view of the problem.

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Thanks, I am not a guru, I am the guru student....

    I have no problem like this. It may be your theme maybe ? I will look into it.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    ok , the profile page in the main style has things hidden. Bellow a hidden part I found. Add this to your custom.css but change display:none to display:block

    .Profile .MeBox {
    display: none;
    }
    
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I tried adding the SideMenuModule to the settings page for online now . I was able to add every other module to the page but that one won't render.

    Maybe guru @peregrine has some idea.....

    peregrinewoft
  • Ok, so although this fixes the issue on the 'Online Settings' page, it then creates issues with the css on the other profile pages, such as showing double on the main edit profile page.
    The css I am using is a copy of the default theme, but modified for my site.
    I looked into how to call it as well but could not figure it out.
    We shall await guru @peregrine‌ to reply :smile:
    Maybe they should mak that a badge?

  • woftwoft
    edited May 2014

    Also don't feel singled out :P this issue is present on all my plugin edit pages haha... :cry:

  • peregrineperegrine MVP
    edited May 2014

    it's the nature of things and not worth fussing with in my opinion. Same reason you don't see discussions on profile page and why you don't see profile on discussion page. no need for it.

    but maybe a guru can help you.

    maybe guru @System can help or guru @Minion‌

    maybe you could fool around with

    ``
    $Sender->EditMode(FALSE);
    $Sender->GetUserInfo($UserID, $Username, $UserID);

    and

    $Sender->EditMode(TRUE);
    $Sender->GetUserInfo($UserID, $Username, $UserID);

    I have no more info to provide than that.

    but its not worth the effort imho

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

    vrijvlinderwoft
  • Yeh, this was my innitial thought as well, but you know when something bugs you and you think it is going to be an easy fix. Plus, i saw it as an opportunity to learn how the core was calling th edifferent modules. But, itjust confused me and like you said become more trouble than it is worth.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes if you make the memodule show on the profile it shows in the wrong places so you would need to add css to hide it from those pages....

    I compared other plugins which do render the side menu in their settings page , like Symbol Edit. There is nothing different really that I can see which would add the module there but not on the settings for online now.

    I am not sure it is needed. From what I can see, these edit options like change picture etc used to popup in 2.0 that is why the link has a class popup. But it does not popup in 2.1 it goes to it's settings page.

    :( Not sure what to add other than I will keep trying to figure out why it does not show out of plain curiosity....

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited May 2014

    Ok I fixed it thanks to guru @peregrine idea and it worked as expected. I added it to line 122 in the default.php like this.

     public function ProfileController_OnlineNow_Create($Sender) {
    
          $Session = Gdn::Session();
          $Sender->EditMode(TRUE);
          $Sender->GetUserInfo($UserID, $Username, $UserID);
          $UserID = $Session->IsValid() ? $Session->UserID : 0;
    
          // Get the data
          $UserMetaData = $this->GetUserMeta($UserID, '%');
          $ConfigArray = array(
                'Plugin.OnlineNow.Invisible' => NULL
             );
    
          if ($Sender->Form->AuthenticatedPostBack() === FALSE) {
             // Convert to using arrays if more options are added.
             $ConfigArray = array_merge($ConfigArray, $UserMetaData);
             $Sender->Form->SetData($ConfigArray);
          }
          else {
             $Values = $Sender->Form->FormValues();
             $FrmValues = array_intersect_key($Values, $ConfigArray);
    
             foreach($FrmValues as $MetaKey => $MetaValue) {
                $this->SetUserMeta($UserID, $this->TrimMetaKey($MetaKey), $MetaValue); 
             }
    
             $Sender->StatusMessage = T("Your changes have been saved.");
          }
    
          $Sender->Render($this->GetView('settings.php'));
       }
    

    @peregrine , you are a freaking genius !!! <3

    woftperegrineR_J
  • @peregrine and @vrijvlinder‌ you are both truly guru's. Thank you!

    vrijvlinder
  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    This sort of thing is what makes me love this vanilla code. It is like reading a mystery novel and peregrine provides the spoilers ;)

    peregrinewoft
Sign In or Register to comment.