示例#1
0
* Module: SmartSection
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
include_once "header.php";
global $smartsection_category_handler, $smartsection_item_handler;
$categoryid = isset($_GET['categoryid']) ? intval($_GET['categoryid']) : 0;
// Creating the category object for the selected category
$categoryObj = new ssCategory($categoryid);
// If the selected category was not found, exit
if ($categoryObj->notLoaded()) {
    redirect_header("javascript:history.go(-1)", 1, _MD_SS_NOCATEGORYSELECTED);
    exit;
}
// Check user permissions to access this category
if (!$categoryObj->checkPermission()) {
    redirect_header("javascript:history.go(-1)", 1, _NOPERM);
    exit;
}
$item_page_id = isset($_GET['page']) ? intval($_GET['page']) : -1;
$totalItem = $smartsection_category_handler->publishedItemsCount();
// If there is no Item under this categories or the sub-categories, exit
if (!isset($totalItem[$categoryid]) || $totalItem[$categoryid] == 0) {
    //redirect_header("index.php", 1, _MD_SS_MAINNOFAQS);
    //exit;
}
$xoopsOption['template_main'] = 'smartsection_category.html';
include_once XOOPS_ROOT_PATH . "/header.php";
include_once "footer.php";
// At which record shall we start
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;