Beispiel #1
0
    if ($xoopsOption['show_cblock'] || isset($xoopsModule) && preg_match("/index\\.php\$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
        $xoopsOption['show_rblock'] = $xoopsOption['show_cblock'] = 1;
    }
    themeheader($xoopsOption['show_rblock']);
    if ($xoopsOption['show_cblock']) {
        make_cblock();
    }
    //create center block
} else {
    $xoopsOption['theme_use_smarty'] = 1;
    // include Smarty template engine and initialize it
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    $xoopsTpl = new XoopsTpl();
    $xoopsTpl->xoops_setCaching(2);
    if ($xoopsConfig['debug_mode'] == 3) {
        $xoopsTpl->xoops_setDebugging(true);
    }
    $xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', 'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
    // Meta tags
    $config_handler =& xoops_gethandler('config');
    $criteria = new CriteriaCompo(new Criteria('conf_modid', 0));
    $criteria->add(new Criteria('conf_catid', XOOPS_CONF_METAFOOTER));
    $config =& $config_handler->getConfigs($criteria, true);
    foreach (array_keys($config) as $i) {
        // prefix each tag with 'xoops_'
        $xoopsTpl->assign('xoops_' . $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
    }
    //unset($config);
    // show banner?
    if ($xoopsConfig['banners'] == 1) {
        $xoopsTpl->assign('xoops_banner', xoops_getbanner());
Beispiel #2
0
function attachfile_display_list($mydirname, $module_dirname, $target_id, $mode)
{
    global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
    $mod_url = XOOPS_URL . '/modules/' . $mydirname;
    $sql = "SELECT * FROM " . $xoopsDB->prefix($mydirname . "_attach") . " WHERE module_dirname='{$module_dirname}' AND target_id={$target_id} ORDER BY attach_id";
    $attached_files =& attachfile_query($sql);
    $attached_files_count = count($attached_files);
    $attached_files4assign = attachfile_htmlspecialchars_to_2array($attached_files);
    // TODO:template cache
    include_once XOOPS_ROOT_PATH . '/class/template.php';
    $xoopsTpl = new XoopsTpl();
    if ($xoopsConfig['debug_mode'] == 3) {
        $xoopsTpl->xoops_setDebugging(true);
    }
    $xoopsTpl->assign(array('module_title' => _MD_ATTACHFILE_TITLE, 'xoops_css' => XOOPS_URL . "/themes/" . $xoopsConfig['theme_set'] . "/style.css", 'mod_url' => $mod_url, 'mydirname' => $mydirname, 'module_dirname' => $module_dirname, 'target_id' => $target_id, 'attached_files_count' => $attached_files_count, 'attached_files' => $attached_files4assign, 'unique_id' => $mydirname . '_COUNT_' . $module_dirname . '_' . $target_id));
    $xoopsTpl->display('db:' . $mydirname . '_' . $mode . '.html');
}