case "setversion": $story = new AmsStory(intval($_POST['storyid'])); $gperm_handler =& xoops_gethandler('groupperm'); if (!$xoopsUser || !$gperm_handler->checkRight("ams_approve", $story->topicid(), $xoopsUser->getGroups(), $xoopsModule->mid())) { redirect_header(XOOPS_URL . '/modules/AMS/article.php?storyid=' . $story->storyid, 3, _NOPERM); exit; } $version_array = explode(".", $_POST['version']); if (!isset($version_array[2])) { $version_array[2] = 0; } if ($story->setCurrentVersion($version_array[0], $version_array[1], $version_array[2])) { $message = sprintf(_AMS_NW_VERSIONUPDATED, implode('.', $version_array)); redirect_header(XOOPS_URL . '/modules/AMS/article.php?storyid=' . $story->storyid, 3, $message); } else { redirect_header(XOOPS_URL . '/modules/AMS/index.php', 3, $story->renderErrors()); } break; case "delversions": $story = new AmsStory(intval($_POST['storyid'])); $gperm_handler =& xoops_gethandler('groupperm'); if (!$xoopsUser || !$gperm_handler->checkRight("ams_approve", $story->topicid(), $xoopsUser->getGroups(), $xoopsModule->mid())) { redirect_header(XOOPS_URL . '/modules/AMS/article.php?storyid=' . $story->storyid, 3, _NOPERM); exit; } if (!empty($_POST['ok'])) { include_once XOOPS_ROOT_PATH . "/header.php"; $story->delversions($_POST['version'], $_POST['revision'], $_POST['revisionminor']); redirect_header(XOOPS_URL . '/modules/AMS/article.php?storyid=' . $story->storyid, 3, sprintf(_AMS_NW_VERSIONUPDATED, $_POST['version'] . "." . $_POST['revision'] . "." . $_POST['revisionminor'])); } else { $version_array = explode(".", $_POST['version']);
redirect_header(XOOPS_URL . '/modules/AMS/index.php', 3, _NOPERM); exit; } $story = new AmsStory($_POST['storyid']); $story->setUid($xoopsUser->getVar('uid')); $story->setHometext($hometext); $story->setBodytext($bodytext); $change = isset($_POST['change']) ? $_POST['change'] : 0; $story->setChange($change); if ($story->calculateVersion(true)) { if ($story->updateVersion()) { $message = sprintf(_AMS_NW_VERSIONUPDATED, $story->version . "." . $story->revision . "." . $story->revisionminor); //redirect_header('article.php?storyid='.$story->storyid(), 3, $message); //exit(); } else { $message = $story->renderErrors(); } } else { $message = $story->renderErrors(); } redirect_header(XOOPS_URL . '/modules/AMS/article.php?storyid=' . $story->storyid(), 3, $message); break; case 'form': default: $story = new AmsStory(); $story->setTitle(''); $story->setHometext(''); $noname = 0; $story->setNohtml(0); $story->setNosmiley(0); $story->setNotifypub(1);
if (isset($results[$mid]) && !isset($results[$mid]['modulename'])) { $results[$mid]['modulename'] = $thismodule->name(); $results[$mid]['dirname'] = $thismodule->dirname(); $results[$mid]['moduleid'] = $thismodule->mid(); } } if (count($results) > 0) { $xoopsTpl->assign('results', $results); } else { $xoopsTpl->assign('message', _SR_NOMATCH); } break; case 'addexternallink': if (isset($_POST['url']) && $_POST['url'] != "" && (isset($_POST['title']) && $_POST['title'] != "")) { if (!$article->addLink(-1, $_POST['url'], $myts->addSlashes($_POST['title']), $_POST['position'])) { $xoopsTpl->assign('message', $article->renderErrors()); } } break; case 'addlink': if (isset($_POST['linkids'])) { $linkids = $_POST['linkids']; $modules = $_POST['modules']; $links = $_POST['links']; $titles = $_POST['titles']; } else { $linkids = array(); $xoopsTpl->assign('message', 'No Link Selected'); } if (count($linkids) > 0) { $errors = 0;
<?php include "../../mainfile.php"; include_once XOOPS_ROOT_PATH . '/modules/AMS/class/class.newsstory.php'; if (empty($_POST['submit'])) { $_POST['submit'] = ''; } $storyid = isset($_POST['storyid']) ? intval($_POST['storyid']) : (isset($_GET['storyid']) ? intval($_GET['storyid']) : 0); if ($storyid > 0) { $article = new AmsStory($storyid); } else { redirect_header(XOOPS_URL . '/modules/AMS/index.php', 3, _AMS_NW_NOSTORY); exit; } if ($_POST['submit'] != '' && $storyid > 0) { if ($article->rateStory($_POST['rating'])) { $ratemessage = _AMS_NW_RATING_SUCCESSFUL; } else { $ratemessage = $article->renderErrors(); } redirect_header(XOOPS_URL . "/modules/AMS/article.php?storyid=" . $article->storyid(), 3, $ratemessage); exit; } else { $xoopsOption['template_main'] = "ams_ratearticle.html"; include XOOPS_ROOT_PATH . "/header.php"; include 'include/ratingform.inc.php'; } $xoopsTpl->assign('breadcrumb', $article->getPath(true) . " > " . _AMS_NW_RATE); include '../../footer.php';