示例#1
0
            // Subscribe the user to On Published notification, if requested
            if ($notifypub) {
                include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
                $notification_handler =& xoops_gethandler('notification');
                $notification_handler->subscribe('item', $newItemObj->itemid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
            }
            // Send notifications
            $newItemObj->sendNotifications(array(_SS_NOT_ITEM_SUBMITTED));
            $redirect_msg = _MD_SS_ITEM_RECEIVED_NEED_APPROVAL;
        }
        redirect_header("index.php", 2, $redirect_msg);
        exit;
        break;
    case 'form':
    default:
        global $xoopsUser, $myts;
        $newItemObj = $smartsection_item_handler->create();
        $categoryObj = $smartsection_category_handler->create();
        $xoopsOption['template_main'] = 'smartsection_submit.html';
        include_once XOOPS_ROOT_PATH . "/header.php";
        include_once "footer.php";
        $name = $xoopsUser ? ucwords($xoopsUser->getVar("uname")) : 'Anonymous';
        $notifypub = 1;
        $xoopsTpl->assign('module_home', ss_module_home());
        $xoopsTpl->assign('categoryPath', _MD_SS_SUB_SNEWNAME);
        $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SS_SUB_SNEWNAME, ucwords($xoopsModule->name())));
        $xoopsTpl->assign('lang_intro_text', ss_getConfig('submitintromsg'));
        include_once SMARTSECTION_ROOT_PATH . 'include/submit.inc.php';
        include_once XOOPS_ROOT_PATH . '/footer.php';
        break;
}
示例#2
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');
示例#3
0
$xoopsTpl->assign('lang_files_linked', _MD_SS_FILES_LINKED);
$xoopsTpl->assign('lang_file_name', _MD_SS_FILENAME);
$xoopsTpl->assign('lang_file_type', _MD_SS_FILE_TYPE);
$xoopsTpl->assign('lang_hits', _MD_SS_HITS);
$xoopsTpl->assign('lang_download_file', _MD_SS_DOWNLOAD_FILE);
$xoopsTpl->assign('lang_page', _MD_SS_PAGE);
$xoopsTpl->assign('lang_previous_item', _MD_SS_PREVIOUS_ITEM);
$xoopsTpl->assign('lang_next_item', _MD_SS_NEXT_ITEM);
$xoopsTpl->assign('module_home', ss_module_home($xoopsModuleConfig['linkedPath']));
$xoopsTpl->assign('categoryPath', $item['categoryPath'] . " > " . $item['title']);
$xoopsTpl->assign('commentatarticlelevel', $xoopsModuleConfig['commentatarticlelevel']);
$xoopsTpl->assign('com_rule', ss_getConfig('com_rule'));
$xoopsTpl->assign('lang_items_links', _MD_SS_ITEMS_LINKS);
$xoopsTpl->assign('previous_item_link', $previous_item_link);
$xoopsTpl->assign('next_item_link', $next_item_link);
$xoopsTpl->assign('previous_item_url', $previous_item_url);
$xoopsTpl->assign('next_item_url', $next_item_url);
$xoopsTpl->assign('other_items', $xoopsModuleConfig['other_items_type']);
$xoopsTpl->assign('itemfooter', ss_getConfig('itemfooter'));
// MetaTag Generator
smartsection_createMetaTags($itemObj->title(), $categoryObj->name(), $itemObj->summary());
// Include the comments if the selected ITEM supports comments
if ($itemObj->cancomment() == 1 || !$xoopsModuleConfig['commentatarticlelevel'] && ss_getConfig('com_rule') != 0) {
    include_once XOOPS_ROOT_PATH . "/include/comment_view.php";
}
//code to include smartie
if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) {
    include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php';
}
//end code for smarttie
include_once XOOPS_ROOT_PATH . '/footer.php';
示例#4
0
        $item = $itemsObj[$i]->toArray($item_page_id);
        $item['categoryname'] = $allcategories[$itemsObj[$i]->categoryid()]->name();
        $item['categorylink'] = "<a href='" . XOOPS_URL . "/modules/smartsection/category.php?categoryid=" . $itemsObj[$i]->categoryid() . "'>" . $allcategories[$itemsObj[$i]->categoryid()]->name() . "</a>";
        $item['who_when'] = $itemsObj[$i]->getWhoAndWhen($users);
        $xoopsTpl->append('items', $item);
    }
}
/// sizeof($items);exit;
// Language constants
$moduleName = $myts->displayTarea($xoopsModule->getVar('name'));
$xoopsTpl->assign(array('lang_on' => _MD_SS_ON, 'lang_postedby' => _MD_SS_POSTEDBY, 'lang_total' => $totalItemsOnPage, 'lang_item' => _MD_SS_TITLE, 'lang_datesub' => _MD_SS_DATESUB, 'lang_hits' => _MD_SS_HITS));
$xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['indexwelcomemsg'], 1));
$xoopsTpl->assign('sectionname', $moduleName);
$xoopsTpl->assign('whereInSection', $moduleName);
$xoopsTpl->assign('module_home', ss_module_home(false));
$xoopsTpl->assign('indexfooter', ss_getConfig('indexfooter'));
// Category Navigation Bar
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', '');
if ($xoopsModuleConfig['useimagenavpage'] == 1) {
    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
} else {
    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
}
// ITEM Navigation Bar
$pagenav = new XoopsPageNav($totalItems, $xoopsModuleConfig['indexperpage'], $start, 'start', '');
if ($xoopsModuleConfig['useimagenavpage'] == 1) {
    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
} else {
    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
}