示例#1
0
} else {
    $sort = 'weight';
    $order = 'ASC';
}
$itemsObj = $smartsection_item_handler->getAllPublished($xoopsModuleConfig['indexperpage'], $start, $categoryid, $sort, $order);
if ($itemsObj) {
    $totalItemOnPage = count($itemsObj);
} else {
    $totalItemOnPage = 0;
}
// Arrays that will hold the informations passed on to smarty variables
$category = array();
$items = array();
// Populating the smarty variables with informations related to the selected category
$category = $categoryObj->toArray(null, true);
$category['categoryPath'] = $categoryObj->getCategoryPath($xoopsModuleConfig['linkedPath']);
//$totalItem = $smartsection_category_handler->publishedItemsCount($xoopsModuleConfig['displaylastitem']);
if ($xoopsModuleConfig['displaylastitem'] == 1) {
    // Get the last smartitem
    $last_itemObj = $smartsection_item_handler->getLastPublishedByCat();
}
$lastitemsize = intval($xoopsModuleConfig['lastitemsize']);
// Creating the sub-categories objects that belong to the selected category
$subcatsObj = $smartsection_category_handler->getCategories(0, 0, $categoryid);
$total_subcats = count($subcatsObj);
//$totalItems = array();
$total_items = 0;
if ($total_subcats != 0) {
    $subcat_keys = array_keys($subcatsObj);
    foreach ($subcat_keys as $i) {
        $subcat_id = $subcatsObj[$i]->getVar('categoryid');