コード例 #1
0
ファイル: versions.php プロジェクト: severnaya99/Sg-2010
if (!isset($_POST['submit'])) {
    if (!isset($_GET['storyid'])) {
        redirect_header(XOOPS_URL . '/modules/AMS/index.php', 3, _AMS_NW_NOSTORY);
        exit;
    }
    $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0;
    // disable caching
    $xoopsOption['template_main'] = "ams_version.html";
    include_once XOOPS_ROOT_PATH . "/header.php";
    $story = new AmsStory(intval($_GET['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;
    }
    $xoopsTpl->assign('breadcrumb', $story->getPath(true) . " > " . _AMS_NW_VERSION);
    $xoopsTpl->assign('lang_go', _GO);
    $xoopsTpl->assign('lang_on', _ON);
    $xoopsTpl->assign('lang_printerpage', _AMS_NW_PRINTERFRIENDLY);
    $xoopsTpl->assign('lang_sendstory', _AMS_NW_SENDSTORY);
    $xoopsTpl->assign('lang_postedby', _POSTEDBY);
    $xoopsTpl->assign('lang_reads', _READS);
    $xoopsTpl->assign('lang_morereleases', _AMS_NW_MORERELEASES);
    $xoopsTpl->assign('versions', $story->getVersions());
    $xoopsTpl->assign('story', $story->toArray(true, false, 0));
} else {
    switch ($_POST['op']) {
        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())) {
コード例 #2
0
ファイル: link.php プロジェクト: severnaya99/Sg-2010
        }
        break;
    case 'dellink':
        if (isset($_POST['linkids'])) {
            $errors = 0;
            foreach ($_POST['linkids'] as $linkid) {
                if (!$article->deleteLink($linkid)) {
                    $errors = 1;
                }
            }
            if ($errors == 1) {
                $xoopsTpl->assign('message', $article->renderErrors());
            }
        } else {
            $xoopsTpl->assign('message', "No link selected");
        }
        break;
}
$existing_links = $article->getLinks();
include 'include/searchform.php';
$search_form->assign($xoopsTpl);
if (count($existing_links) > 0) {
    $xoopsTpl->assign('related', $existing_links);
}
$xoopsTpl->assign('breadcrumb', $article->getPath(true) . " > " . _AMS_NW_MANAGELINK);
$xoopsTpl->assign('story', $article->toArray());
$xoopsTpl->assign('lang_on', _ON);
$xoopsTpl->assign('lang_postedby', _POSTEDBY);
$xoopsTpl->assign('lang_reads', _READS);
$xoopsTpl->assign('xoops_pagetitle', $myts->htmlSpecialChars($xoopsModule->name()) . ' - ' . $myts->htmlSpecialChars($article->title()));
include XOOPS_ROOT_PATH . '/footer.php';
コード例 #3
0
ファイル: ratefile.php プロジェクト: severnaya99/Sg-2010
<?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';
コード例 #4
0
ファイル: submit.php プロジェクト: severnaya99/Sg-2010
 if ($approveprivilege) {
     $change = isset($_POST['change']) ? $_POST['change'] : 0;
     $story->setChange($change);
     $nohtml = isset($_POST['nohtml']) ? intval($_POST['nohtml']) : 0;
     $story->setNohtml($nohtml);
     if (!isset($_POST['approve'])) {
         $story->setApproved(0);
     } else {
         $story->setApproved($_POST['approve']);
     }
 } else {
     $story->setNohtml = 1;
 }
 //Display breadcrumbs
 if ($edit) {
     echo $story->getPath(true) . " > " . _EDIT . " " . $story->title();
 }
 //Display post preview
 $p_title = $story->title("Preview");
 $p_hometext = $story->hometext("Preview");
 $p_hometext .= "<br />" . $story->bodytext("Preview");
 $topversion = $story->revision == 0 && $story->revisionminor == 0 ? 1 : 0;
 $topicalign = isset($story->topicalign) ? 'align="' . $story->topicalign() . '"' : "";
 $p_hometext = $xt->topic_imgurl() != '' && $story->topicdisplay() ? '<img src="images/topics/' . $xt->topic_imgurl() . '" ' . $story->topicalign() . ' alt="" />' . $p_hometext : $p_hometext;
 //Added  in AMS 2.50 Final. replace deprecated themecenterposts function
 if (file_exists(XOOPS_ROOT_PATH . "/Frameworks/xoops22/class/xoopsformloader.php")) {
     if (!@(include_once XOOPS_ROOT_PATH . "/Frameworks/xoops22/class/xoopsformloader.php")) {
         include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
     }
 } else {
     include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
コード例 #5
0
ファイル: article.php プロジェクト: severnaya99/Sg-2010
$xoopsTpl->assign('lang_printerpage', _AMS_NW_PRINTERFRIENDLY);
$xoopsTpl->assign('lang_sendstory', _AMS_NW_SENDSTORY);
$xoopsTpl->assign('lang_on', _AMS_NW_PUBLISHED_DATE);
$xoopsTpl->assign('lang_postedby', _AMS_NW_POSTEDBY);
$xoopsTpl->assign('lang_reads', _AMS_NW_READS);
if ($article->friendlyurl_enable != 1) {
    $xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_AMS_NW_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_AMS_NW_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPS_URL . '/modules/AMS/article.php?storyid=' . $article->storyid());
} else {
    $xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_AMS_NW_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_AMS_NW_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . $article->friendlyurl);
}
$xoopsTpl->assign('related', $article->getLinks());
$xoopsTpl->assign('page', $storypage);
$xoopsTpl->assign('admin', $admin);
$xoopsTpl->assign('hasversions', $article->hasVersions());
$xoopsTpl->assign('lang_attached_files', _AMS_NW_ATTACHEDFILES);
$sfiles = new sFiles();
$filesarr = array();
$newsfiles = array();
$filesarr = $sfiles->getAllbyStory($storyid);
$filescount = count($filesarr);
$xoopsTpl->assign('attached_files_count', $filescount);
if ($filescount > 0) {
    foreach ($filesarr as $onefile) {
        $newsfiles[] = array('file_id' => $onefile->getFileid(), 'visitlink' => XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/visit.php?fileid=' . $onefile->getFileid(), 'file_realname' => $onefile->getFileRealName(), 'file_attacheddate' => formatTimestamp($onefile->getDate()), 'file_mimetype' => $onefile->getMimetype(), 'file_downloadname' => XOOPS_UPLOAD_URL . '/' . $onefile->getDownloadname());
    }
    $xoopsTpl->assign('attached_files', $newsfiles);
}
$xoopsTpl->assign('xoops_pagetitle', $myts->htmlSpecialChars($xoopsModule->name()) . ' - ' . $myts->htmlSpecialChars($article->topic_title()) . ' - ' . $myts->htmlSpecialChars($article->title()));
$xoopsTpl->assign('breadcrumb', $article->getPath());
include XOOPS_ROOT_PATH . '/include/comment_view.php';
include XOOPS_ROOT_PATH . '/footer.php';