예제 #1
0
 if (isset($matches['artlang'])) {
     $artlang = $matches['artlang'];
 }
 // Sanity check
 if (is_null($cat) || is_null($id) || is_null($artlang)) {
     header('HTTP/1.1 403 Forbidden');
     print 'Invalid FAQ link.';
     exit;
 }
 // Load categories
 $category = new PMF_Category();
 // Load the required faq
 $faq = new PMF_Faq();
 $faq->getRecord($id);
 // Get the HTML content
 $html = @PMF_Utils::getHTTPContent($link);
 // Try to attach the PDF content
 $pdfFile = $faq->buildPDFFile($cat);
 foreach ($mailto['mailto'] as $recipient) {
     $recipient = trim(strip_tags($recipient));
     if (!empty($recipient)) {
         $mail = new PMF_Mail();
         $mail->unsetFrom();
         $mail->setFrom($mailfrom, $name);
         $mail->addTo($recipient);
         $mail->subject = $PMF_LANG["msgS2FMailSubject"] . $name;
         $mail->message = $faqconfig->get("main.send2friendText") . "\r\n\r\n" . $PMF_LANG["msgS2FText2"] . "\r\n" . $link . "\r\n\r\n" . $attached;
         if ($html !== false) {
             $mail->messageAlt = $faqconfig->get("main.send2friendText") . "\r\n\r\n" . $PMF_LANG["msgS2FText2"] . "\r\n" . $link . "\r\n\r\n" . $attached;
             $mail->setHTMLMessage($html);
         }