diff --git a/include/comment.php b/include/comment.php index 703cf62..d26f088 100644 --- a/include/comment.php +++ b/include/comment.php @@ -163,11 +163,6 @@ class Comment { return true; } - function getOutputEditorValues($aClean) - { - /* Stub */ - } - /** * Removes the current comment from the database. @@ -200,48 +195,65 @@ class Comment { return $oRow->cnt; } - /** - * class static functions - */ + function getOutputEditorValues($aClean) + { + $this->sSubject = $aClean['sSubject']; + $this->sBody = $aClean['sBody']; + $this->iParentId = $aClean['iThread']; + $this->iVersionId = $aClean['iVersionId']; + + if(!$this->oOwner) + $this->oOwner = $_SESSION['current']; + + if(!$this->sDateCreated) + $this->sDateCreated = date("l F jS Y, H:i"); + } /** * display a single comment (in $oRow) */ function view_app_comment($oRow) + { + $oComment = new comment(null, $oRow); + $oComment->display(); + } + + function display() { echo html_frame_start('','98%'); echo '
| commentId.">\n";
- echo " ".$oRow->subject." \n"; - echo " by ".forum_lookup_user($oRow->userId)." on ".$oRow->time." \n"; + echo " |
| iCommentId.">\n";
+ echo " ".$this->sSubject." \n"; + echo " by ".forum_lookup_user($this->oOwner->iUserId)." on ".$this->sDateCreated." \n"; echo " |
| \n";
// body
- echo htmlify_urls($oRow->body), " \n"; + echo htmlify_urls($this->sBody), " \n"; // only add RE: once - if(eregi("RE:", $oRow->subject)) - $subject = $oRow->subject; + if(eregi("RE:", $this->sSubject)) + $sSubject = $this->sSubject; else - $subject = "RE: ".$oRow->subject; + $sSubject = "RE: ".$this->sSubject; + $oVersion = new version($this->iVersionId); + $oM = new objectManager("comment", "Post new ocmment"); + $oM->setReturnTo($oVersion->objectMakeUrl()); // reply post buttons - echo " [appId&iVersionId=$oRow->versionId\">post new] \n"; - echo " [appId&iVersionId=$oRow->versionId&sSubject=". - urlencode("$subject")."&iThread=$oRow->commentId\">reply to this] \n"; + echo " [makeUrl("add")."&iAppId=$this->iAppId&iVersionId=$this->iVersionId\">post new] \n"; + echo " [makeUrl("add")."&iAppId=$this->iAppId&iVersionId=$this->iVersionId&sSubject=". + urlencode("$sSubject")."&iThread=$this->iCommentId\">reply to this] \n"; echo " |