Context->WarningCollector->Count() > 0) { $CommentList .= '
'.$this->Context->GetDefinition('ErrorTitle').'
' .$this->Context->WarningCollector->GetMessages() .'
'; } else { $PageDetails = $this->pl->GetPageDetails($this->Context); $PageList = $this->pl->GetNumericList(); $SessionPostBackKey = $this->Context->Session->GetVariable('SessionPostBackKey', 'string'); $CommentList .= '

'; if ($this->Context->Configuration['USE_CATEGORIES']) $CommentList .= ''.$this->Discussion->Category.': '; $CommentList .= DiscussionPrefix($this->Context, $this->Discussion).' '; if ($this->Discussion->WhisperUserID > 0) { $CommentList .= $this->Discussion->WhisperUsername.': '; } $CommentList .= $this->Discussion->Name .'

'.$this->Context->GetDefinition('BottomOfPage').'

'.$PageDetails.'

'.$PageList.'
    '; $Comment = $this->Context->ObjectFactory->NewContextObject($this->Context, 'Comment'); $RowNumber = 0; $CommentID = 0; $Alternate = 0; // Define the current user's permissions and preferences // (small optimization so they don't have to be checked every loop): $PERMISSION_EDIT_COMMENTS = $this->Context->Session->User->Permission('PERMISSION_EDIT_COMMENTS'); $PERMISSION_HIDE_COMMENTS = $this->Context->Session->User->Permission('PERMISSION_HIDE_COMMENTS'); $PERMISSION_EDIT_DISCUSSIONS = $this->Context->Session->User->Permission('PERMISSION_EDIT_DISCUSSIONS'); while ($Row = $this->Context->Database->GetRow($this->CommentData)) { if ($RowNumber > 0) $PERMISSION_EDIT_DISCUSSIONS = 0; $RowNumber++; $Comment->Clear(); $Comment->GetPropertiesFromDataSet($Row, $this->Context->Session->UserID); $CommentAuthUsername = $Comment->AuthUsername; // Get an unencoded version of the author's username $ShowHtml = $Comment->FormatPropertiesForDisplay(); $ShowIcon = $Comment->AuthIcon != '' ? 1 : 0; $this->DelegateParameters['ShowHtml'] = &$ShowHtml; $this->DelegateParameters['ShowIcon'] = &$ShowIcon; $this->DelegateParameters['RowNumber'] = &$RowNumber; $CommentClass = ''; if ($Comment->WhisperUserID > 0) { if ( ($Comment->WhisperUserID == $this->Context->Session->UserID && $Comment->AuthUserID == $this->Context->Session->UserID) or $Comment->WhisperUserID == $this->Context->Session->UserID ) { $CommentClass = 'WhisperTo'; } else { $CommentClass = 'WhisperFrom'; } } else if ($this->Discussion->WhisperUserID > 0) { $CommentClass = ($Comment->AuthUserID == $this->Context->Session->UserID) ? 'WhisperFrom' : 'WhisperTo'; } if ($Comment->Deleted) $CommentClass .= ' Hidden'; if ($Alternate) $CommentClass .= ' Alternate'; $CommentClass = trim($CommentClass); $CommentList .= '
    • '.($ShowIcon?'
      AuthIcon."');".'"> 
      ':'').' '.$this->Context->GetDefinition('CommentAuthor').''.$Comment->AuthUsername.''; // Point out who it was whispered to if necessary if ($Comment->WhisperUserID > 0) { if ($Comment->WhisperUserID == $this->Context->Session->UserID && $Comment->AuthUserID == $this->Context->Session->UserID) { $CommentList .= $this->Context->GetDefinition('ToYourself'); } elseif ($Comment->WhisperUserID == $this->Context->Session->UserID) { $CommentList .= $this->Context->GetDefinition('ToYou'); } else { $CommentList .= str_replace('//1', $Comment->WhisperUsername, $this->Context->GetDefinition('ToX')); } } $CommentList .= '
    • '.$this->Context->GetDefinition('CommentTime').''.TimeDiff($this->Context, $Comment->DateCreated); if ($Comment->DateEdited != '') $CommentList .= ' '.$this->Context->GetDefinition('Edited').''; if ($Comment->Deleted) $CommentList .= ' '.str_replace(array('//1', '//2'), array(TimeDiff($this->Context, $Comment->DateDeleted), $Comment->DeleteUsername), $this->Context->GetDefinition('CommentHiddenOnXByY')).''; // Whisper back button if (!$this->Discussion->Closed && $Comment->WhisperUserID > 0 && $Comment->WhisperUserID == $this->Context->Session->UserID) $CommentList .= 'DiscussionID."', '".str_replace("'", "\'", $CommentAuthUsername)."', '".$this->Context->Configuration['BASE_URL']."');" .'">'.$this->Context->GetDefinition('WhisperBack').''; $CommentList .= '
     '; // Set up comment options $this->DelegateParameters['Comment'] = &$Comment; $this->DelegateParameters['CommentList'] = &$CommentList; $this->DelegateParameters['RowNumber'] = &$RowNumber; $CommentList .= $this->CallDelegate('PreCommentOptionsRender'); if ($this->Context->Session->UserID > 0) { if ($Comment->AuthUserID == $this->Context->Session->UserID || $PERMISSION_EDIT_COMMENTS || $PERMISSION_EDIT_DISCUSSIONS) { if ((!$this->Discussion->Closed && $this->Discussion->Active) || $PERMISSION_EDIT_COMMENTS || $PERMISSION_EDIT_DISCUSSIONS) $CommentList .= ''.$this->Context->GetDefinition('edit').' '; } if ($PERMISSION_HIDE_COMMENTS) $CommentList .= 'Context->Configuration['WEB_ROOT']."ajax/switch.php', '".($Comment->Deleted?"0":"1")."', '".$this->Discussion->DiscussionID."', '".$Comment->CommentID."', '".$this->Context->GetDefinition("ShowConfirm")."', '".$this->Context->GetDefinition("HideConfirm")."', 'HideComment".$Comment->CommentID."', '".$SessionPostBackKey."');" .' return false;">'.$this->Context->GetDefinition($Comment->Deleted?'Show':'Hide').' '; } $this->DelegateParameters['CommentList'] = &$CommentList; $this->CallDelegate('PostCommentOptionsRender'); $CommentList .= '
    '; if ($Comment->AuthRoleDesc != '') $CommentList .= '
    '.$Comment->AuthRoleDesc.'
    '; $CommentList .= '
    '; $CommentList .= $Comment->Body.'
  1. '; $Alternate = FlipBool($Alternate); } $CommentList .= '
'; if (@$PageList && @$PageDetails) { $CommentList .= '

'.$PageDetails.'

'.$PageList.'
'; } } echo $CommentList; ?>