Ejemplo n.º 1
0
    global $xoopsConfig, $xoopsUser, $xoopsDB;
    $myts =& MyTextSanitizer::getInstance();
    $result = $xoopsDB->query("SELECT title, content FROM " . $xoopsDB->prefix("seccont") . " WHERE artid={$artid}");
    list($title, $content) = $xoopsDB->fetchRow($result);
    $title = $myts->makeTboxData4Show($title);
    $content = $myts->makeTareaData4Show($content);
    echo "\r\n        <html>\r\n        <head><title>" . $xoopsConfig['sitename'] . "</title></head>\r\n        <body>\r\n        <table border='0'><tr><td>\r\n        <table border='0' width='640' cellpadding='0' cellspacing='1' bgcolor='#000000'><tr><td>\r\n        <table border='0' width='640' cellpadding='20' cellspacing='1' bgcolor='#ffffff'><tr><td>\r\n        <img src='" . XOOPS_URL . "/images/logo.gif' border='0' alt='' /><br /><br />\r\n        <b>{$title}</b><br />\r\n        " . str_replace("[pagebreak]", "", $content) . "<br /><br />";
    echo "</td></tr></table></td></tr></table>";
    echo "<br /><br />";
    printf(_MD_COMESFROM, $xoopsConfig['sitename']);
    echo "<br /><a href='" . XOOPS_URL . "'>" . XOOPS_URL . "</a><br /><br />";
    echo _MD_URLFORTHIS . "<br />\r\n        <a href='" . XOOPS_URL . "/modules/sections/index.php?op=viewarticle&artid={$artid}'>" . XOOPS_URL . "/modules/sections/index.php?op=viewarticle&artid={$artid}</a>\r\n        </td></tr></table>\r\n        </body>\r\n        </html>";
}
$op = isset($HTTP_GET_VARS['op']) ? trim($HTTP_GET_VARS['op']) : '';
$secid = isset($HTTP_GET_VARS['secid']) ? intval($HTTP_GET_VARS['secid']) : 0;
$page = isset($HTTP_GET_VARS['page']) ? intval($HTTP_GET_VARS['page']) : 0;
$artid = isset($HTTP_GET_VARS['artid']) ? intval($HTTP_GET_VARS['artid']) : 0;
switch ($op) {
    case "viewarticle":
        viewarticle($artid, $page);
        break;
    case "listarticles":
        listarticles($secid);
        break;
    case "printpage":
        PrintSecPage($artid);
        break;
    default:
        listsections();
        break;
}
Ejemplo n.º 2
0
    $result = sql_query("SELECT userlevel FROM " . $NPDS_Prefix . "sections WHERE secid='{$secid}'");
    list($userlevel) = sql_fetch_row($result);
    $okprint = false;
    $okprint = autorisation_section($userlevel);
    return $okprint;
}
settype($op, 'string');
switch ($op) {
    case "viewarticle":
        if (verif_aff($artid)) {
            settype($page, 'string');
            viewarticle($artid, $page);
        } else {
            header("location: sections.php");
        }
        break;
    case "listarticles":
        listarticles($secid);
        break;
    case "printpage":
        if (verif_aff($artid)) {
            PrintSecPage($artid);
        } else {
            header("location: sections.php");
        }
        break;
    default:
        settype($rubric, 'string');
        listsections($rubric);
        break;
}