Fork me on GitHub

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Please upgrade to 2.1.x here. The 2.0 branch is no longer being updated.
Important security fix: 2.1.10, released 4 May.

How can i make visible for only moderators and admins?

jone68jone68 New
edited September 2011 in Vanilla 2.0 Help
This discussion is related to the WhosOnline addon.
How can i make Who is online visible for moderators and admins only?
Tagged:

Best Answer

  • Answer ✓

    1 . adding an option
    whosonline.php

        +                   <tr>
        +                      <th><?php
        +                         echo $this->Form->Checkbox('WhosOnline.Moderators', 
        +                         "Hide for all the logged users but moderators");
        +                      ?></th>
        +                   </tr>   
    

    2 . Box
    \forum\plugins\WhosOnline\class.whosonlinemodule.php

        +       $ShowToModerators = (C('WhosOnline.Moderators') ? 1 : 0);
        +       if ($ShowToModerators) $AdminMode=' adm.';
    
        +       if ( !$ShowToModerators || ( $ShowToModerators && 
        +      $Session->CheckPermission('Garden.Moderation.Manage')))
        +        {
                    ob_start();
                    ?>
    

    3 . Profile
    default.php

    +$ConfigurationModel->SetField(array('WhosOnline.Location.Show', 'WhosOnline.Frequency', 'WhosOnline.Hide', 'WhosOnline.Moderators'));
    
    
    
             +$ShowToModerators = (C('WhosOnline.Moderators') ? 1 : 0);                            
             +if ( !$ShowToModerators || ( $ShowToModerators && 
             +$Session->CheckPermission('Garden.Moderation.Manage')))
             +{
                $SideMenu->AddLink('Options', T('Who\'s Online Settings'), '/profile/whosonline', FALSE, array('class' => 'Popup'));
             +}
    

Answers

  • Answer ✓

    1 . adding an option
    whosonline.php

        +                   <tr>
        +                      <th><?php
        +                         echo $this->Form->Checkbox('WhosOnline.Moderators', 
        +                         "Hide for all the logged users but moderators");
        +                      ?></th>
        +                   </tr>   
    

    2 . Box
    \forum\plugins\WhosOnline\class.whosonlinemodule.php

        +       $ShowToModerators = (C('WhosOnline.Moderators') ? 1 : 0);
        +       if ($ShowToModerators) $AdminMode=' adm.';
    
        +       if ( !$ShowToModerators || ( $ShowToModerators && 
        +      $Session->CheckPermission('Garden.Moderation.Manage')))
        +        {
                    ob_start();
                    ?>
    

    3 . Profile
    default.php

    +$ConfigurationModel->SetField(array('WhosOnline.Location.Show', 'WhosOnline.Frequency', 'WhosOnline.Hide', 'WhosOnline.Moderators'));
    
    
    
             +$ShowToModerators = (C('WhosOnline.Moderators') ? 1 : 0);                            
             +if ( !$ShowToModerators || ( $ShowToModerators && 
             +$Session->CheckPermission('Garden.Moderation.Manage')))
             +{
                $SideMenu->AddLink('Options', T('Who\'s Online Settings'), '/profile/whosonline', FALSE, array('class' => 'Popup'));
             +}
    
Sign In or Register to comment.