applications/dashboard/controllers/class.profilecontroller.php
public function Activity($UserReference = '', $Username = '', $UserID = '', $Page = '') {
      $this->Permission('Garden.Profiles.View');
      $this->EditMode(FALSE);
      
      // Object setup
      $Session = Gdn::Session();
      $this->ActivityModel = new ActivityModel();
      
      // Calculate offset.
      list($Offset, $Limit) = OffsetLimit($Page, 30);
      
      // Get user, tab, and comment
      $this->GetUserInfo($UserReference, $Username, $UserID);
      $UserID = $this->User->UserID;
      $Username = $this->User->Name;
      
      $this->_SetBreadcrumbs(T('Activity'), UserUrl($this->User, '', 'activity'));
      
      $this->SetTabView('Activity');
      $Comment = $this->Form->GetFormValue('Comment');
      
      // Load data to display
      $this->ProfileUserID = $this->User->UserID;
      $Limit = 30;

      $NotifyUserIDs = array(ActivityModel::NOTIFY_PUBLIC);
      if (Gdn::Session()->CheckPermission('Garden.Moderation.Manage'))
         $NotifyUserIDs[] = ActivityModel::NOTIFY_MODS;

      $Activities = $this->ActivityModel->GetWhere(
         array('ActivityUserID' => $UserID, 'NotifyUserID' => $NotifyUserIDs), 
         $Offset, $Limit)->ResultArray();
      $this->ActivityModel->JoinComments($Activities);
      $this->SetData('Activities', $Activities);
      if (count($Activities) > 0) {
         $LastActivity = $Activities[0];
         $LastModifiedDate = Gdn_Format::ToTimestamp($this->User->DateUpdated);
         $LastActivityDate = Gdn_Format::ToTimestamp($LastActivity['DateInserted']);
         if ($LastModifiedDate < $LastActivityDate)
            $LastModifiedDate = $LastActivityDate;

         // Make sure to only query this page if the user has no new activity since the requesting browser last saw it.
         $this->SetLastModified($LastModifiedDate);
      }

      // Set the canonical Url.
      if (is_numeric($this->User->Name) || Gdn_Format::Url($this->User->Name) != strtolower($this->User->Name)) {
         $this->CanonicalUrl(Url('profile/'.$this->User->UserID.'/'.Gdn_Format::Url($this->User->Name), TRUE));
      } else {
         $this->CanonicalUrl(Url('profile/'.strtolower($this->User->Name), TRUE));
      }
      
      $this->Render();
   }
public function Activity($UserReference = '', $Username = '', $UserID = '', $Page = '') {
      $this->Permission('Garden.Profiles.View');
      $this->EditMode(FALSE);
      
      // Object setup
      $Session = Gdn::Session();
      $this->ActivityModel = new ActivityModel();
      
      // Calculate offset.
      list($Offset, $Limit) = OffsetLimit($Page, 30);
      
      // Get user, tab, and comment
      $this->GetUserInfo($UserReference, $Username, $UserID);
      $UserID = $this->User->UserID;
      $Username = $this->User->Name;
      
      $this->_SetBreadcrumbs(T('Activity'), UserUrl($this->User, '', 'activity'));
      
      $this->SetTabView('Activity');
      $Comment = $this->Form->GetFormValue('Comment');
      
      // Load data to display
      $this->ProfileUserID = $this->User->UserID;
      $Limit = 30;

      $NotifyUserIDs = array(ActivityModel::NOTIFY_PUBLIC);
      if (Gdn::Session()->CheckPermission('Garden.Moderation.Manage'))
         $NotifyUserIDs[] = ActivityModel::NOTIFY_MODS;

      $Activities = $this->ActivityModel->GetWhere(
         array('ActivityUserID' => $UserID, 'NotifyUserID' => $NotifyUserIDs), 
         $Offset, $Limit)->ResultArray();
      $this->ActivityModel->JoinComments($Activities);
      $this->SetData('Activities', $Activities);
      if (count($Activities) > 0) {
         $LastActivity = $Activities[0];
         $LastModifiedDate = Gdn_Format::ToTimestamp($this->User->DateUpdated);
         $LastActivityDate = Gdn_Format::ToTimestamp($LastActivity['DateInserted']);
         if ($LastModifiedDate < $LastActivityDate)
            $LastModifiedDate = $LastActivityDate;

         // Make sure to only query this page if the user has no new activity since the requesting browser last saw it.
         $this->SetLastModified($LastModifiedDate);
      }

      // Set the canonical Url.
      if (is_numeric($this->User->Name) || Gdn_Format::Url($this->User->Name) != strtolower($this->User->Name)) {
         $this->CanonicalUrl(Url('profile/'.$this->User->UserID.'/'.Gdn_Format::Url($this->User->Name), TRUE));
      } else {
         $this->CanonicalUrl(Url('profile/'.strtolower($this->User->Name), TRUE));
      }
      
      $this->Render();
   }
public function Activity ( $ UserReference = '' , $ Username = '' , $ UserID = '' , $ Page = '' ) { $ this -> Permission ( 'Garden.Profiles.View' ) ; $ this -> EditMode ( FALSE ) ; // Object setup $ Session = Gdn :: Session ( ) ; $ this -> ActivityModel = new ActivityModel ( ) ; // Calculate offset. list ( $ Offset , $ Limit ) = OffsetLimit ( $ Page , 30 ) ; // Get user, tab, and comment $ this -> GetUserInfo ( $ UserReference , $ Username , $ UserID ) ; $ UserID = $ this -> User -> UserID ; $ Username = $ this -> User -> Name ; $ this -> _SetBreadcrumbs ( T ( 'Activity' ) , UserUrl ( $ this -> User , '' , 'activity' ) ) ; $ this -> SetTabView ( 'Activity' ) ; $ Comment = $ this -> Form -> GetFormValue ( 'Comment' ) ; // Load data to display $ this -> ProfileUserID = $ this -> User -> UserID ; $ Limit = 30 ; $ NotifyUserIDs = array ( ActivityModel :: NOTIFY_PUBLIC ) ; if ( Gdn :: Session ( ) -> CheckPermission ( 'Garden.Moderation.Manage' ) ) $ NotifyUserIDs [ ] = ActivityModel :: NOTIFY_MODS ; $ Activities = $ this -> ActivityModel -> GetWhere ( array ( 'ActivityUserID' => $ UserID , 'NotifyUserID' => $ NotifyUserIDs ) , $ Offset , $ Limit ) -> ResultArray ( ) ; $ this -> ActivityModel -> JoinComments ( $ Activities ) ; $ this -> SetData ( 'Activities' , $ Activities ) ; if ( count ( $ Activities ) > 0 ) { $ LastActivity = $ Activities [ 0 ] ; $ LastModifiedDate = Gdn_Format :: ToTimestamp ( $ this -> User -> DateUpdated ) ; $ LastActivityDate = Gdn_Format :: ToTimestamp ( $ LastActivity [ 'DateInserted' ] ) ; if ( $ LastModifiedDate < $ LastActivityDate ) $ LastModifiedDate = $ LastActivityDate ; // Make sure to only query this page if the user has no new activity since the requesting browser last saw it. $ this -> SetLastModified ( $ LastModifiedDate ) ; } // Set the canonical Url. if ( is_numeric ( $ this -> User -> Name ) || Gdn_Format :: Url ( $ this -> User -> Name ) != strtolower ( $ this -> User -> Name ) ) { $ this -> CanonicalUrl ( Url ( 'profile/' . $ this -> User -> UserID . '/' . Gdn_Format :: Url ( $ this -> User -> Name ) , TRUE ) ) ; } else { $ this -> CanonicalUrl ( Url ( 'profile/' . strtolower ( $ this -> User -> Name ) , TRUE ) ) ; } $ this -> Render ( ) ; }
Show activity feed for this user.

@since 2.0.0
@access public
@param mixed $UserReference Unique identifier, possible ID or username.
@param string $Username Username.
@param int $UserID Unique ID.
@param int $Offset How many to skip (for paging).
Show activity feed for this user .