示例#1
0
    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);
$xoopsTpl->assign('item', $item);
if (ss_getConfig('footerprint') == 'item footer' || ss_getConfig('footerprint') == 'both') {
    $xoopsTpl->assign('itemfooter', $myts->displayTarea(ss_getConfig('itemfooter')));
}
if (ss_getConfig('footerprint') == 'index footer' || ss_getConfig('footerprint') == 'both') {
    $xoopsTpl->assign('indexfooter', $myts->displayTarea(ss_getConfig('indexfooter')));
}
$xoopsTpl->assign('display_whowhen_link', $xoopsModuleConfig['display_whowhen_link']);
$xoopsTpl->display('db:smartsection_print.html');
示例#2
0
/**
* $Id: items_spot.php,v 1.2 2005/08/02 03:47:51 mauriciodelima Exp $
* Module: SmartSection
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
function b_items_spot_show($options)
{
    include_once XOOPS_ROOT_PATH . "/modules/smartsection/include/common.php";
    $opt_display_last = $options[0];
    $opt_items_count = $options[1];
    $opt_categoryid = $options[2];
    $sel_items = explode(',', $options[3]);
    $opt_display_poster = $options[4];
    $opt_display_comment = $options[5];
    $opt_display_type = $options[6];
    if ($opt_categoryid == 0) {
        $opt_categoryid = -1;
    }
    $block = array();
    $smartsection_item_handler =& ss_gethandler('item');
    if ($opt_display_last == 1) {
        $itemsObj =& $smartsection_item_handler->getAllPublished($opt_items_count, 0, $opt_categoryid, $sort = 'datesub', $order = 'DESC', 'summary');
        $i = 1;
        $itemsCount = count($itemsObj);
        if ($itemsObj) {
            foreach ($itemsObj as $key => $thisitem) {
                $item = array();
                $item = $thisitem->toArray();
                $item['who_when'] = sprintf(_MB_SS_WHO_WHEN, $thisitem->posterName(), $thisitem->datesub());
                if ($i < $itemsCount) {
                    $item['showline'] = true;
                } else {
                    $item['showline'] = false;
                }
                $i++;
                $block['items'][] = $item;
            }
        }
    } else {
        $i = 1;
        $itemsCount = count($sel_items);
        foreach ($sel_items as $item_id) {
            $itemObj = new ssItem($item_id);
            if (!$itemObj->notLoaded()) {
                $categoryObj =& $itemObj->category();
                $item = array();
                $item = $itemObj->toArray();
                $item['who_when'] = sprintf(_MB_SS_WHO_WHEN, $itemObj->posterName(), $itemObj->datesub());
                if ($i < $itemsCount) {
                    $item['showline'] = true;
                } else {
                    $item['showline'] = false;
                }
                $i++;
                $block['items'][] = $item;
            }
        }
    }
    $block['lang_reads'] = _MB_SS_READS;
    $block['lang_comments'] = _MB_SS_COMMENTS;
    $block['lang_readmore'] = _MB_SS_READMORE;
    $block['display_whowhen_link'] = $opt_display_poster;
    $block['display_comment_link'] = $opt_display_comment;
    $block['display_type'] = $opt_display_type;
    return $block;
}