Esempio n. 1
0
     while ($row = $db->fetchObject($result)) {
         if ($searchcat != 0 && $searchcat != (int) $row->category_id) {
             continue;
         }
         $faq->faqRecords[] = array('id' => $row->id, 'category_id' => $row->category_id, 'solution_id' => $row->solution_id, 'lang' => $row->lang, 'active' => $row->active, 'sticky' => $row->sticky, 'title' => $row->thema, 'content' => $row->content, 'date' => PMF_Date::createIsoDate($row->date));
         if (!isset($numActiveByCat[$row->category_id])) {
             $numActiveByCat[$row->category_id] = 0;
         }
         $numActiveByCat[$row->category_id] += $row->active ? 1 : 0;
     }
 }
 $num = count($faq->faqRecords);
 if ($num > 0) {
     $old = 0;
     $all_ids = $visits = array();
     foreach (PMF_Visits::getInstance()->getAllData() as $visit) {
         $visits[$visit['id']] = $visit['lang'];
     }
     foreach ($faq->faqRecords as $record) {
         $catInfo = '';
         $isBracketOpened = false;
         $needComma = false;
         $cid = $record['category_id'];
         if (isset($numRecordsByCat[$cid]) && $numRecordsByCat[$cid] > 0) {
             if (!$isBracketOpened) {
                 $catInfo .= ' (';
                 $isBracketOpened = true;
             }
             $catInfo .= sprintf('<span id="category_%d_item_count">%d</span> %s', $cid, $numRecordsByCat[$cid], $PMF_LANG['msgEntries']);
         }
         if (isset($numRecordsByCat[$cid]) && $numRecordsByCat[$cid] > $numActiveByCat[$cid]) {
Esempio n. 2
0
if (!is_null($showCaptcha)) {
    $captcha->showCaptchaImg();
    exit;
}
$currentCategory = $cat;
$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&amp;cat=%d&amp;id=%d&amp;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);