예제 #1
0
 $faqSearchResult->reviewResultset($mergedResult);
 if (0 < $faqSearchResult->getNumberOfResults()) {
     $response = sprintf('<p>%s</p>', $plr->GetMsg('plmsgSearchAmount', $faqSearchResult->getNumberOfResults()));
     $response .= '<ul>';
     foreach ($faqSearchResult->getResultset() as $result) {
         $url = sprintf('/index.php?action=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $result->category_id, $result->id, $result->lang);
         $oLink = new PMF_Link(PMF_Configuration::getInstance()->get('main.referenceURL') . $url);
         $oLink->text = PMF_Utils::chopString($result->question, 15);
         $oLink->itemTitle = $result->question;
         $response .= sprintf('<li>%s<br /><div class="searchpreview">%s...</div></li>', $oLink->toHtmlAnchor(), PMF_Utils::chopString(strip_tags($result->answer), 10));
     }
     $response .= '</ul>';
     $message = array('result' => $response);
 } else {
     $questionData = array('username' => $name, 'email' => $email, 'category_id' => $ucategory, 'question' => $question, 'is_visible' => $visibility);
     $faq->addQuestion($questionData);
     $questionMail = "User: "******", mailto:" . $questionData['email'] . "\n" . $PMF_LANG["msgCategory"] . ": " . $categories[$questionData['category_id']]["name"] . "\n\n" . wordwrap($question, 72) . "\n\n" . $faqconfig->get('main.referenceURL') . '/admin/';
     $userId = $cat->getCategoryUser($questionData['category_id']);
     $oUser = new PMF_User();
     $oUser->getUserById($userId);
     $userEmail = $oUser->getUserData('email');
     $mainAdminEmail = PMF_Configuration::getInstance()->get('main.administrationMail');
     $mail = new PMF_Mail();
     $mail->setReplyTo($questionData['email'], $questionData['username']);
     $mail->addTo($mainAdminEmail);
     // Let the category owner get a copy of the message
     if ($userEmail && $mainAdminEmail != $userEmail) {
         $mail->addCc($userEmail);
     }
     $mail->subject = '%sitename%';
     $mail->message = $questionMail;