Esempio n. 1
0
$recordId = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solutionId = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
// Get all data from the FAQ record
if (0 == $solutionId) {
    $faq->getRecord($recordId);
} else {
    $faq->getRecordBySolutionId($solutionId);
}
$recordId = $faq->faqRecord['id'];
try {
    $faqsession->userTracking('article_view', $recordId);
} catch (PMF_Exception $e) {
    // @todo handle the exception
}
$faqVisits = new PMF_Visits($faqConfig);
$faqVisits->logViews($recordId);
// Add Glossary entries for answers only
$question = $faq->getRecordTitle($recordId);
$answer = $oGlossary->insertItemsIntoContent($faq->faqRecord['content']);
// Set the path of the current category
$categoryName = $category->getPath($currentCategory, ' » ', true);
$changeLanguagePath = PMF_Link::getSystemRelativeUri() . sprintf('?%saction=artikel&cat=%d&id=%d&artlang=%s', $sids, $currentCategory, $recordId, $LANGCODE);
$oLink = new PMF_Link($changeLanguagePath, $faqConfig);
$oLink->itemTitle = $faq->getRecordTitle($recordId, false);
$changeLanguagePath = $oLink->toString();
$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED);
if (!is_null($highlight) && $highlight != "/" && $highlight != "<" && $highlight != ">" && PMF_String::strlen($highlight) > 3) {
    $highlight = str_replace("'", "´", $highlight);
    $highlight = str_replace(array('^', '.', '?', '*', '+', '{', '}', '(', ')', '[', ']'), '', $highlight);
    $highlight = preg_quote($highlight, '/');
    $searchItems = explode(' ', $highlight);