Exemple #1
0
$record_id = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solution_id = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED);
$faqsession->userTracking('article_view', $record_id);
// Get all data from the FAQ record
if (0 == $solution_id) {
    $faq->getRecord($record_id);
} else {
    $faq->getRecordBySolutionId($solution_id);
}
$faqvisits = PMF_Visits::getInstance();
$faqvisits->logViews($faq->faqRecord['id']);
$content = $faq->faqRecord['content'];
$thema = $faq->getRecordTitle($faq->faqRecord['id']);
// Add Glossary entries
$content = $oGlossary->insertItemsIntoContent($content);
$thema = $oGlossary->insertItemsIntoContent($thema);
// Set the path of the current category
$categoryName = $categoryLayout->renderBreadcrumb($categoryPath);
$changeLanguagePath = PMF_Link::getSystemRelativeUri() . sprintf('?%saction=artikel&cat=%d&id=%d&artlang=%s', $sids, $currentCategory, $id, $LANGCODE);
$oLink = new PMF_Link($changeLanguagePath);
$oLink->itemTitle = $faq->getRecordTitle($record_id, 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);
    $attributes = array('href', 'src', 'title', 'alt', 'class', 'style', 'id', 'name', 'face', 'size', 'dir', 'onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup');
    foreach ($searchItems as $item) {
Exemple #2
0
$news_id = PMF_Filter::filterInput(INPUT_GET, 'newsid', FILTER_VALIDATE_INT);
if (is_null($news_id)) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('news_view', $id);
// Define the header of the page
$writeNewsHeader = $faqconfig->get('main.titleFAQ') . $PMF_LANG['msgNews'];
$writeNewsRSS = '&nbsp;<a href="feed/news/rss.php" target="_blank"><img id="newsRSS" src="images/feed.png" width="16" height="16" alt="RSS" /></a>';
// Get all data from the news record
$news = $oNews->getNewsEntry($news_id);
$content = $news['content'];
$header = $news['header'];
// Add Glossary entries
$oGlossary = new PMF_Glossary();
$content = $oGlossary->insertItemsIntoContent($content);
$header = $oGlossary->insertItemsIntoContent($header);
// Add information link if existing
if (strlen($news['link']) > 0) {
    $content .= sprintf('</p><p>%s<a href="%s" target="%s">%s</a>', $PMF_LANG['msgInfo'], $news['link'], $news['target'], $news['linkTitle']);
}
// Show link to edit the news?
$editThisEntry = '';
if (isset($permission['editnews'])) {
    $editThisEntry = sprintf('<a href="%sadmin/index.php?action=news&amp;do=edit&amp;id=%d">%s</a>', PMF_Link::getSystemRelativeUri('index.php'), $news_id, $PMF_LANG['ad_menu_news_edit']);
}
// Is the news item expired?
$expired = date('YmdHis') > $news['dateEnd'];
// Does the user have the right to add a comment?
if (!$news['active'] || !$news['allowComments'] || $expired) {
    $commentMessage = $PMF_LANG['msgWriteNoComment'];
Exemple #3
0
$recordId = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
$solutionId = PMF_Filter::filterInput(INPUT_GET, 'solution_id', FILTER_VALIDATE_INT);
$highlight = PMF_Filter::filterInput(INPUT_GET, 'highlight', FILTER_SANITIZE_STRIPPED);
// Set the FAQ language
$faq->setLanguage($lang);
// Get all data from the FAQ record
if (0 == $solutionId) {
    $faq->getRecord($recordId);
} else {
    $faq->getRecordBySolutionId($solutionId);
}
$faqsession->userTracking('article_view', $faq->faqRecord['id']);
$faqVisits = PMF_Visits::getInstance();
$faqVisits->logViews($faq->faqRecord['id']);
// Add Glossary entries
$question = $oGlossary->insertItemsIntoContent($faq->getRecordTitle($faq->faqRecord['id']));
$answer = $oGlossary->insertItemsIntoContent($faq->faqRecord['content']);
// Set the path of the current category
$categoryName = $category->getPath($currentCategory, ' &raquo; ', true);
$changeLanguagePath = PMF_Link::getSystemRelativeUri() . sprintf('?%saction=artikel&amp;cat=%d&amp;id=%d&amp;artlang=%s', $sids, $currentCategory, $faq->faqRecord['id'], $LANGCODE);
$oLink = new PMF_Link($changeLanguagePath);
$oLink->itemTitle = $faq->getRecordTitle($faq->faqRecord['id'], 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);
    foreach ($searchItems as $item) {
        $question = PMF_Utils::setHighlightedString($question, $item);
Exemple #4
0
$newsId = PMF_Filter::filterInput(INPUT_GET, 'newsid', FILTER_VALIDATE_INT);
if (is_null($newsId)) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
$faqsession->userTracking('news_view', $id);
// Define the header of the page
$newsMainHeader = $faqconfig->get('main.titleFAQ') . $PMF_LANG['msgNews'];
$newsFeed = '&nbsp;<a href="feed/news/rss.php" target="_blank"><img id="newsRSS" src="images/feed.png" width="16" height="16" alt="RSS" /></a>';
// Get all data from the news record
$news = $oNews->getNewsEntry($newsId);
$newsContent = $news['content'];
$newsHeader = $news['header'];
// Add Glossary entries
$oGlossary = new PMF_Glossary();
$newsContent = $oGlossary->insertItemsIntoContent($newsContent);
$newsHeader = $oGlossary->insertItemsIntoContent($newsHeader);
// Add information link if existing
if (strlen($news['link']) > 0) {
    $newsContent .= sprintf('</p><p>%s<a href="%s" target="%s">%s</a>', $PMF_LANG['msgInfo'], $news['link'], $news['target'], $news['linkTitle']);
}
// Show link to edit the news?
$editThisEntry = '';
if (isset($permission['editnews'])) {
    $editThisEntry = sprintf('<a href="%sadmin/index.php?action=news&amp;do=edit&amp;id=%d">%s</a>', PMF_Link::getSystemRelativeUri('index.php'), $newsId, $PMF_LANG['ad_menu_news_edit']);
}
// Is the news item expired?
$expired = date('YmdHis') > $news['dateEnd'];
// Does the user have the right to add a comment?
if (!$news['active'] || !$news['allowComments'] || $expired) {
    $commentMessage = $PMF_LANG['msgWriteNoComment'];
Exemple #5
0
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, ' &raquo; ', true);
$changeLanguagePath = PMF_Link::getSystemRelativeUri() . sprintf('?%saction=artikel&amp;cat=%d&amp;id=%d&amp;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);
    foreach ($searchItems as $item) {
        $question = PMF_Utils::setHighlightedString($question, $item);
        $answer = PMF_Utils::setHighlightedString($answer, $item);