コード例 #1
0
ファイル: showversion.php プロジェクト: severnaya99/Sg-2010
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)));
$storyid = isset($_GET['storyid']) ? intval($_GET['storyid']) : 0;
$version = isset($_GET['version']) ? intval($_GET['version']) : 0;
$revision = isset($_GET['revision']) ? intval($_GET['revision']) : 0;
$revisionminor = isset($_GET['revisionminor']) ? intval($_GET['revisionminor']) : 0;
if (!$storyid || !$version) {
    redirect_header(XOOPS_URL . "/modules/AMS/index.php", 2, _AMS_NW_NOSTORY);
    exit;
}
$myts =& MyTextSanitizer::getInstance();
// set comment mode if not set
$article = new AmsStory();
$article->getNewsVersion($storyid, $version, $revision, $revisionminor);
$gperm_handler =& xoops_gethandler('groupperm');
if (is_object($xoopsUser)) {
    $groups = $xoopsUser->getGroups();
} else {
    $groups = XOOPS_GROUP_ANONYMOUS;
}
if (!$gperm_handler->checkRight("ams_approve", $article->topicid(), $groups, $xoopsModule->getVar('mid'))) {
    redirect_header(XOOPS_URL . '/modules/AMS/index.php', 3, _NOPERM);
    exit;
}
$xoopsOption['template_main'] = 'ams_article.html';
include_once XOOPS_ROOT_PATH . '/header.php';
$xoopsTpl->assign('story', $article->toArray(true, false, -1));
$banner = $myts->displayTarea($article->getBanner(), 1);
if (!$banner || $banner == "") {