include_once XOOPS_ROOT_PATH . '/modules/AMS/language/english/main.php'; } if (!$xoopsUser) { redirect_header(XOOPS_URL . '/modules/AMS/index.php', 3, _NOPERM); } include_once XOOPS_ROOT_PATH . '/modules/AMS/class/class.newsstory.php'; $storyid = isset($_POST['storyid']) ? intval($_POST['storyid']) : (isset($_GET['storyid']) ? intval($_GET['storyid']) : 0); if (!$storyid) { redirect_header(XOOPS_URL . "/modules/AMS/index.php", 2, _AMS_NW_NOSTORY); exit; } $article = new AmsStory($storyid); if ($xoopsUser->getVar('uid') != $article->uid()) { $gperm_handler =& xoops_gethandler('groupperm'); $groups = $xoopsUser->getGroups(); if (!$gperm_handler->checkRight("ams_approve", $article->topicid(), $groups, $xoopsModule->getVar('mid'))) { redirect_header(XOOPS_URL . '/modules/AMS/index.php', 3, _NOPERM); exit; } } $op = isset($_POST['op']) ? $_POST['op'] : "default"; $myts =& MyTextSanitizer::getInstance(); $xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0; // disable caching $xoopsOption['template_main'] = 'ams_searchform.html'; include_once XOOPS_ROOT_PATH . '/header.php'; $username = isset($_POST['username']) && $_POST['username'] != "" ? $_POST['username'] : ''; $username = $myts->addSlashes($username); $queries = array(); $andor = isset($_POST['andor']) ? $_POST['andor'] : "AND";
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']); if (!isset($version_array[2])) { $version_array[2] = 0; } include_once XOOPS_ROOT_PATH . "/header.php"; xoops_confirm(array('op' => 'delversions', 'submit' => 1, 'ok' => 1, 'storyid' => $_POST['storyid'], 'version' => $version_array[0], 'revision' => $version_array[1], 'revisionminor' => $version_array[2]), 'versions.php', _AMS_NW_RUSUREDELVERSIONS); } break; case "delallversions": $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->delallversions($_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']); if (!isset($version_array[2])) { $version_array[2] = 0; } include_once XOOPS_ROOT_PATH . "/header.php"; xoops_confirm(array('op' => 'delallversions', 'submit' => 1, 'ok' => 1, 'storyid' => $_POST['storyid'], 'version' => $version_array[0], 'revision' => $version_array[1], 'revisionminor' => $version_array[2]), 'versions.php', _AMS_NW_RUSUREDELALLVERSIONS); }
$xoopsTpl->assign('currentyear', $fromyear); $xoopsTpl->assign('lang_actions', _AMS_NW_ACTIONS); $xoopsTpl->assign('lang_date', _AMS_NW_DATE); $xoopsTpl->assign('lang_views', _AMS_NW_VIEWS); // must adjust the selected time to server timestamp $timeoffset = $useroffset - $xoopsConfig['server_TZ']; $monthstart = mktime(0 - $timeoffset, 0, 0, $frommonth, 1, $fromyear); $monthend = mktime(23 - $timeoffset, 59, 59, $frommonth + 1, 0, $fromyear); $monthend = $monthend > time() ? time() : $monthend; $sql = "SELECT * FROM " . $xoopsDB->prefix("ams_article") . " WHERE published >= {$monthstart} and published <= {$monthend} ORDER by published DESC"; $result = $xoopsDB->query($sql); $count = 0; while ($myrow = $xoopsDB->fetchArray($result)) { $article = new AmsStory($myrow); $story = array(); $story['title'] = "<a href='index.php?storytopic=" . $article->topicid() . "'>" . $article->topic_title() . "</a>: <a href='article.php?storyid=" . $article->storyid() . "'>" . $article->title() . "</a>"; $story['counter'] = $article->counter(); $story['date'] = formatTimestamp($article->published(), "m", $useroffset); $story['print_link'] = 'print.php?storyid=' . $article->storyid(); $story['mail_link'] = 'mailto:?subject=' . sprintf(_AMS_NW_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_AMS_NW_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/article.php?storyid=' . $article->storyid(); $xoopsTpl->append('stories', $story); $count++; } $xoopsTpl->assign('lang_printer', _AMS_NW_PRINTERFRIENDLY); $xoopsTpl->assign('lang_sendstory', _AMS_NW_SENDSTORY); $xoopsTpl->assign('lang_storytotal', sprintf(_AMS_NW_THEREAREINTOTAL, $count)); } else { $xoopsTpl->assign('show_articles', false); } $xoopsTpl->assign('lang_newsarchives', _AMS_NW_NEWSARCHIVES); include XOOPS_ROOT_PATH . "/footer.php";