Esempio n. 1
0
         $_REQUEST['anon_name'] = $_REQUEST['comment_name'];
     }
 }
 // this commentsParentId is some crazy ass business - lets prepare for the day when this can be removed
 // there are references to it in LibertyComments::verifyComments as well
 $_REQUEST['comments_parent_id'] = $commentsParentId;
 $storeComment = new LibertyComment(@BitBase::verifyId($editComment->mCommentId) ? $editComment->mCommentId : NULL);
 if (empty($formfeedback['error']) && $storeComment->storeComment($_REQUEST)) {
     // store successful
     $storeComment->loadComment();
     if (empty($_REQUEST['post_comment_id']) && $gBitSystem->isPackageActive('switchboard')) {
         // A new comment, and we have switchboard to send notifications
         global $gSwitchboardSystem;
         // Draft the message:
         $message['subject'] = tra('New comment on:') . ' ' . $gContent->getTitle() . ' @ ' . $gBitSystem->getConfig('site_title');
         $message['message'] = tra('A new message was posted to ') . ' ' . $gContent->getTitle() . "<br/>\n" . $gContent->getDisplayUri() . "<br/>\n" . '/----- ' . tra('Here is the message') . " -----/<br/>\n<br/>\n" . '<h2>' . $storeComment->getTitle() . "</h2>\n" . tra('By') . ' ' . $gBitUser->getDisplayName() . "\n<p>" . $storeComment->parseData() . '</p>';
         $gSwitchboardSystem->sendEvent('My Content', 'new comment', $gContent->mContentId, $message);
     }
     $postComment = NULL;
 } else {
     // store fails handle errors and preview
     $formfeedback['error'] = array_merge($formfeedback['error'], $storeComment->mErrors);
     $postComment['data'] = !empty($_REQUEST['comment_data']) ? $_REQUEST['comment_data'] : '';
     $postComment['title'] = !empty($_REQUEST['comment_title']) ? $_REQUEST['comment_title'] : '';
     if (!empty($_REQUEST['comment_name'])) {
         $postComment['anon_name'] = $_REQUEST['comment_name'];
     }
     $_REQUEST['post_comment_request'] = TRUE;
     //this is critical and triggers other settings if store fails - do not remove without looking at what preview effects
     $_REQUEST['post_comment_preview'] = TRUE;
 }