original_string: public function ProfileController_AddProfileTabs_Handler($Sender) {
        if (is_object($Sender->User) && $Sender->User->UserID > 0) {
           $UserID = $Sender->User->UserID;
           // Add the discussion tab
           $DiscussionsLabel = Sprite('SpDiscussions').' '.T('Discussions');
           $CommentsLabel = Sprite('SpComments').' '.T('Comments');
           if (C('Vanilla.Profile.ShowCounts', TRUE)) {
              $DiscussionsLabel .= '<span class="Aside">'.CountString(GetValueR('User.CountDiscussions', $Sender, NULL), "/profile/count/discussions?userid=$UserID").'</span>';
              $CommentsLabel .= '<span class="Aside">'.CountString(GetValueR('User.CountComments', $Sender, NULL), "/profile/count/comments?userid=$UserID").'</span>';
           }
           $Sender->AddProfileTab(T('Discussions'), 'profile/discussions/'.$Sender->User->UserID.'/'.rawurlencode($Sender->User->Name), 'Discussions', $DiscussionsLabel);
           $Sender->AddProfileTab(T('Comments'), 'profile/comments/'.$Sender->User->UserID.'/'.rawurlencode($Sender->User->Name), 'Comments', $CommentsLabel);
           // Add the discussion tab's CSS and Javascript.
           $Sender->AddJsFile('jquery.gardenmorepager.js');
           $Sender->AddJsFile('discussions.js');
        }
     }
code: public function ProfileController_AddProfileTabs_Handler($Sender) {
        if (is_object($Sender->User) && $Sender->User->UserID > 0) {
           $UserID = $Sender->User->UserID;
           // Add the discussion tab
           $DiscussionsLabel = Sprite('SpDiscussions').' '.T('Discussions');
           $CommentsLabel = Sprite('SpComments').' '.T('Comments');
           if (C('Vanilla.Profile.ShowCounts', TRUE)) {
              $DiscussionsLabel .= '<span class="Aside">'.CountString(GetValueR('User.CountDiscussions', $Sender, NULL), "/profile/count/discussions?userid=$UserID").'</span>';
              $CommentsLabel .= '<span class="Aside">'.CountString(GetValueR('User.CountComments', $Sender, NULL), "/profile/count/comments?userid=$UserID").'</span>';
           }
           $Sender->AddProfileTab(T('Discussions'), 'profile/discussions/'.$Sender->User->UserID.'/'.rawurlencode($Sender->User->Name), 'Discussions', $DiscussionsLabel);
           $Sender->AddProfileTab(T('Comments'), 'profile/comments/'.$Sender->User->UserID.'/'.rawurlencode($Sender->User->Name), 'Comments', $CommentsLabel);
           // Add the discussion tab's CSS and Javascript.
           $Sender->AddJsFile('jquery.gardenmorepager.js');
           $Sender->AddJsFile('discussions.js');
        }
     }
code_tokens: public function ProfileController_AddProfileTabs_Handler ( $ Sender ) { if ( is_object ( $ Sender -> User ) && $ Sender -> User -> UserID > 0 ) { $ UserID = $ Sender -> User -> UserID ; // Add the discussion tab $ DiscussionsLabel = Sprite ( 'SpDiscussions' ) . ' ' . T ( 'Discussions' ) ; $ CommentsLabel = Sprite ( 'SpComments' ) . ' ' . T ( 'Comments' ) ; if ( C ( 'Vanilla.Profile.ShowCounts' , TRUE ) ) { $ DiscussionsLabel .= '<span class="Aside">' . CountString ( GetValueR ( 'User.CountDiscussions' , $ Sender , NULL ) , "/profile/count/discussions?userid=$UserID" ) . '</span>' ; $ CommentsLabel .= '<span class="Aside">' . CountString ( GetValueR ( 'User.CountComments' , $ Sender , NULL ) , "/profile/count/comments?userid=$UserID" ) . '</span>' ; } $ Sender -> AddProfileTab ( T ( 'Discussions' ) , 'profile/discussions/' . $ Sender -> User -> UserID . '/' . rawurlencode ( $ Sender -> User -> Name ) , 'Discussions' , $ DiscussionsLabel ) ; $ Sender -> AddProfileTab ( T ( 'Comments' ) , 'profile/comments/' . $ Sender -> User -> UserID . '/' . rawurlencode ( $ Sender -> User -> Name ) , 'Comments' , $ CommentsLabel ) ; // Add the discussion tab's CSS and Javascript. $ Sender -> AddJsFile ( 'jquery.gardenmorepager.js' ) ; $ Sender -> AddJsFile ( 'discussions.js' ) ; } }
docstring: Adds 'Discussions' tab to profiles and adds CSS & JS files to their head.
  
  @since 2.0.0
  @package Vanilla
  
  @param object $Sender ProfileController.
docstring_tokens: Adds Discussions tab to profiles and adds CSS & JS files to their head .