Exemple #1
0
 /**
  * Adds a comment
  *
  * @param array $commentData Array with comment data
  * 
  * @return boolean
  */
 function addComment($commentData)
 {
     $oComment = new PMF_Comment();
     return $oComment->addComment($commentData);
 }
Exemple #2
0
     case 'faq':
         $id = $faqid;
         break;
 }
 // If e-mail address is set to optional
 if (!$faqConfig->get('main.optionalMailAddress') && is_null($mail)) {
     $mail = $faqConfig->get('main.administrationMail');
 }
 if (!is_null($username) && !empty($username) && !empty($mail) && !is_null($mail) && !is_null($comment) && !empty($comment) && $stopwords->checkBannedWord($comment) && !$faq->commentDisabled($id, $languageCode, $type)) {
     try {
         $faqsession->userTracking('save_comment', $id);
     } catch (PMF_Exception $e) {
         // @todo handle the exception
     }
     $commentData = array('record_id' => $id, 'type' => $type, 'username' => $username, 'usermail' => $mail, 'comment' => nl2br($comment), 'date' => $_SERVER['REQUEST_TIME'], 'helped' => '');
     if ($oComment->addComment($commentData)) {
         $emailTo = $faqConfig->get('main.administrationMail');
         $urlToContent = '';
         if ('faq' == $type) {
             $faq->getRecord($id);
             if ($faq->faqRecord['email'] != '') {
                 $emailTo = $faq->faqRecord['email'];
             }
             $faqUrl = sprintf('%s?action=artikel&cat=%d&id=%d&artlang=%s', $faqConfig->get('main.referenceURL'), 0, $faq->faqRecord['id'], $faq->faqRecord['lang']);
             $oLink = new PMF_Link($faqUrl, $faqConfig);
             $oLink->itemTitle = $faq->faqRecord['title'];
             $urlToContent = $oLink->toString();
         } else {
             $oNews = new PMF_News($faqConfig);
             $news = $oNews->getNewsEntry($id);
             if ($news['authorEmail'] != '') {