* under the License. */ if (!defined('IS_VALID_PHPMYFAQ')) { header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME'])); exit; } $currentCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT); if (!is_null($currentCategory) && isset($category->categoryName[$currentCategory])) { $faqsession->userTracking('show_category', $currentCategory); $parent = $category->categoryName[$currentCategory]['parent_id']; $name = $category->categoryName[$currentCategory]['name']; $records = $faq->showAllRecords($currentCategory, $faqconfig->get('records.orderby'), $faqconfig->get('records.sortby')); if (!$records) { $subCategory = new PMF_Category($current_user, $current_groups, true); $subCategory->transform($currentCategory); $records = $subCategory->viewTree(); } $up = ''; if ($parent != 0) { $url = sprintf('%saction=show&cat=%d', $sids, $parent); $oLink = new PMF_Link(PMF_Link::getSystemRelativeUri() . '?' . $url); $oLink->itemTitle = $category->categoryName[$parent]['name']; $oLink->text = $PMF_LANG['msgCategoryUp']; $up = $oLink->toHtmlAnchor(); } $tpl->processTemplate('writeContent', array('writeCategory' => $PMF_LANG['msgEntriesIn'] . $name, 'writeThemes' => $records, 'writeOneThemeBack' => $up)); $tpl->includeTemplate('writeContent', 'index'); } else { $faqsession->userTracking('show_all_categories', 0); $tpl->processTemplate('writeContent', array('writeCategory' => $PMF_LANG['msgFullCategories'], 'writeThemes' => $category->viewTree(), 'writeOneThemeBack' => '')); $tpl->includeTemplate('writeContent', 'index');
exit; } $currentCategory = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT); $subCategoryContent = ''; if (!is_null($currentCategory) && isset($category->categoryName[$currentCategory])) { $faqsession->userTracking('show_category', $currentCategory); $catParent = $category->categoryName[$currentCategory]['parent_id']; $catName = $category->categoryName[$currentCategory]['name']; $catDescription = $category->categoryName[$currentCategory]['description']; $records = $faq->showAllRecords($currentCategory, $faqConfig->get('records.orderby'), $faqConfig->get('records.sortby')); if (empty($records) || $category->getChildNodes($currentCategory)) { $subCategory = new PMF_Category($faqConfig, $current_groups, true); $subCategory->setUser($current_user); $subCategory->transform($currentCategory); if (empty($records)) { $records = $subCategory->viewTree(); } if (count($category->getChildNodes($currentCategory))) { $categoryFaqsHeader = $PMF_LANG['msgSubCategories']; $subCategoryContent = $subCategory->viewTree(); $tpl->parseBlock('writeContent', 'subCategories', array('categorySubsHeader' => $categoryFaqsHeader)); } } $up = ''; if ($catParent != 0) { $url = sprintf('%s?%saction=show&cat=%d', PMF_Link::getSystemRelativeUri(), $sids, $catParent); $oLink = new PMF_Link($url, $faqConfig); $oLink->itemTitle = $category->categoryName[$catParent]['name']; $oLink->text = $PMF_LANG['msgCategoryUp']; $up = $oLink->toHtmlAnchor(); }