}
 $recordData = array('id' => $recordId, 'lang' => $recordLang, 'revision_id' => $revisionId, 'active' => $active, 'sticky' => !is_null($sticky) ? 1 : 0, 'thema' => html_entity_decode($question), 'content' => html_entity_decode($content), 'keywords' => $keywords, 'author' => $author, 'email' => $email, 'comment' => !is_null($comment) ? 'y' : 'n', 'date' => empty($date) ? date('YmdHis') : str_replace(array('-', ':', ' '), '', $date), 'dateStart' => empty($dateStart) ? '00000000000000' : str_replace('-', '', $dateStart) . '000000', 'dateEnd' => empty($dateEnd) ? '99991231235959' : str_replace('-', '', $dateEnd) . '235959', 'linkState' => '', 'linkDateCheck' => 0);
 // Create ChangeLog entry
 $faq->createChangeEntry($recordId, $user->getUserId(), nl2br($changed), $recordLang, $revisionId);
 // Create the visit entry
 $visits = new PMF_Visits($faqConfig);
 $visits->add($recordId);
 // save or update the FAQ record
 if ($faq->isAlreadyTranslated($recordId, $recordLang)) {
     $faq->updateRecord($recordData);
 } else {
     $recordId = $faq->addRecord($recordData, false);
 }
 if ($recordId) {
     printf('<p class="alert alert-success">%s</p>', $PMF_LANG['ad_entry_savedsuc']);
     PMF_Helper_Linkverifier::linkOndemandJavascript($recordId, $recordLang);
 } else {
     printf('<p class="alert alert-error">%s</p>', print $PMF_LANG['ad_entry_savedfail'] . $faqConfig->getDb()->error());
 }
 if (!isset($categories['rubrik'])) {
     $categories['rubrik'] = array();
 }
 // delete category relations
 $faq->deleteCategoryRelations($recordId, $recordLang);
 // save or update the category relations
 $faq->addCategoryRelations($categories['rubrik'], $recordId, $recordLang);
 // Insert the tags
 if ($tags != '') {
     $tagging->saveTags($recordId, explode(',', trim($tags)));
 } else {
     $tagging->deleteTagsFromRecordId($recordId);
         // deletes question
         $faq->deleteQuestion($openQuestionId);
     } else {
         // adds this faq record id to the related open question
         $faq->updateQuestionAnswer($openQuestionId, $recordId, $categories['rubrik'][0]);
     }
     $url = sprintf('%s?action=artikel&cat=%d&id=%d&artlang=%s', $faqConfig->get('main.referenceURL'), $categories['rubrik'][0], $recordId, $recordLang);
     $oLink = new PMF_Link($url, $faqConfig);
     // notify the user who added the question
     $notifyEmail = PMF_Filter::filterInput(INPUT_POST, 'notifyEmail', FILTER_SANITIZE_EMAIL);
     $notifyUser = PMF_Filter::filterInput(INPUT_POST, 'notifyUser', FILTER_SANITIZE_STRING);
     $notification = new PMF_Notification($faqConfig);
     $notification->sendOpenQuestionAnswered($notifyEmail, $notifyUser, $oLink->toString());
 }
 // Call Link Verification
 PMF_Helper_Linkverifier::linkOndemandJavascript($recordId, $recordData['lang']);
 // Callback to Twitter if enabled
 if ($faqConfig->get('socialnetworks.enableTwitterSupport')) {
     require '../inc/libs/twitteroauth/twitteroauth.php';
     $connection = new TwitterOAuth($faqConfig->get('socialnetworks.twitterConsumerKey'), $faqConfig->get('socialnetworks.twitterConsumerSecret'), $faqConfig->get('socialnetworks.twitterAccessTokenKey'), $faqConfig->get('socialnetworks.twitterAccessTokenSecret'));
     $link = PMF_Link::getSystemRelativeUri() . sprintf('?action=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $category, $recordId, $recordLang);
     $link = $faqConfig->get('main.referenceURL') . str_replace('/admin/', '/', $link);
     $oLink = new PMF_Link($link, $faqConfig);
     $oLink->itemTitle = $question;
     $link = $oLink->toString();
     if ($connection) {
         $twitter = new PMF_Services_Twitter($connection);
         $twitter->addPost($question, $tags, $link);
     }
 }
 // All the other translations
Пример #3
0
</html>
<?php 
    exit;
}
$faq->faqRecord = null;
$faq->getRecord($id);
if (!isset($faq->faqRecord['content'])) {
    ?>
    Error: No entry for #<?php 
    print $id;
    ?>
(<?php 
    print $artlang;
    ?>
) available.
</body>
</html>
<?php 
    exit;
}
if (!is_null($lookup)) {
    if (count(ob_list_handlers()) > 0) {
        ob_clean();
    }
    print $linkverifier->verifyArticleURL($faq->faqRecord['content'], $id, $artlang);
    exit;
}
PMF_Helper_Linkverifier::linkOndemandJavascript($id, $artlang);
?>
</body>
</html>