exit; } // Creating the item object for the selected item $itemObj = $smartsection_item_handler->get($itemid); // If the selected item was not found, exit if (!$itemObj) { redirect_header("javascript:history.go(-1)", 1, _MD_SS_NOITEMSELECTED); exit; } $xoopsOption['template_main'] = 'smartsection_item.html'; include_once XOOPS_ROOT_PATH . "/header.php"; include_once "footer.php"; // Creating the category object that holds the selected item $categoryObj =& $smartsection_category_handler->get($itemObj->categoryid()); // Check user permissions to access that category of the selected item if (!ss_itemAccessGranted($itemObj->itemid(), $itemObj->categoryid())) { redirect_header("javascript:history.go(-1)", 1, _NOPERM); exit; } // Update the read counter of the selected item if (!$xoopsUser || $xoopsUser->isAdmin($xoopsModule->mid()) && $xoopsModuleConfig['adminhits'] == 1 || $xoopsUser && !$xoopsUser->isAdmin($xoopsModule->mid())) { $itemObj->updateCounter(); } // Retreiving the objects of this category if ($xoopsModuleConfig['orderbydate'] == 1) { $orderBy = 'datesub'; $ascOrDesc = 'DESC'; } else { $orderBy = 'weight'; $ascOrDesc = 'ASC'; }
$itemid = isset($_GET['itemid']) ? intval($_GET['itemid']) : 0; if ($itemid == 0) { redirect_header("javascript:history.go(-1)", 1, _MD_SS_NOITEMSELECTED); exit; } // Creating the ITEM object for the selected ITEM $itemObj = new ssItem($itemid); // If the selected ITEM was not found, exit if ($itemObj->notLoaded()) { redirect_header("javascript:history.go(-1)", 1, _MD_SS_NOITEMSELECTED); exit; } // Creating the category object that holds the selected ITEM $categoryObj =& $itemObj->category(); // Check user permissions to access that category of the selected ITEM if (!ss_itemAccessGranted($itemObj->getVar('itemid'), $itemObj->getVar('categoryid'))) { redirect_header("javascript:history.go(-1)", 1, _NOPERM); exit; } $xoopsTpl = new XoopsTpl(); global $xoopsConfig, $xoopsDB, $xoopsModule, $myts; $item = $itemObj->toArray(null, $categoryObj, false); $printtitle = $xoopsConfig['sitename'] . " - " . smartsection_metagen_html2text($categoryObj->getCategoryPath()) . " > " . $myts->displayTarea($item['title']); $printheader = $myts->displayTarea(ss_getConfig('headerprint')); $who_where = sprintf(_MD_SS_WHO_WHEN, $itemObj->posterName(), $itemObj->datesub()); $item['categoryname'] = $myts->displayTarea($categoryObj->name()); $xoopsTpl->assign('printtitle', $printtitle); $xoopsTpl->assign('printlogourl', ss_getConfig('printlogourl')); $xoopsTpl->assign('printheader', $printheader); $xoopsTpl->assign('lang_category', _MD_SS_CATEGORY); $xoopsTpl->assign('lang_author_date', $who_where);