コード例 #1
0
ファイル: link.php プロジェクト: severnaya99/Sg-2010
         //query string too short
     }
     $queries = array($myts->addSlashes($query));
 }
 $module_handler =& xoops_gethandler('module');
 if ($username != "") {
     $member_handler =& xoops_gethandler('member');
     $criteria = new Criteria('uname', '%' . $username . '%', 'LIKE');
     $users = $member_handler->getUserList($criteria);
 } else {
     $users = 0;
 }
 foreach ($_POST['mids'] as $mid) {
     $thismodule =& $module_handler->get($mid);
     if ($users == 0) {
         $thisresult = $thismodule->search($queries, $andor, 10, 0, 0, $article->storyid());
         if (count($thisresult) > 0) {
             foreach ($thisresult as $key => $searchresult) {
                 if ($mid == $xoopsModule->getVar('mid')) {
                     if (isset($searchresult['id']) && $searchresult['id'] == $storyid) {
                         unset($thisresult[$key]);
                         continue;
                     }
                 }
                 $thisresult[$key]['title'] = $myts->htmlSpecialChars($searchresult['title']);
             }
             $results[$mid]['results'][0] = $thisresult;
         }
     } else {
         foreach ($users as $userid => $username) {
             $thisresult = $thismodule->search($queries, $andor, 10, 0, $userid, $article->storyid());
コード例 #2
0
ファイル: archive.php プロジェクト: severnaya99/Sg-2010
    $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']) . '&amp;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";
コード例 #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
     $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);
     $story->setTopicId(0);
     if ($approveprivilege) {
         $story->setTopicdisplay(0);
         $story->setTopicalign('R');
         $story->setIhome(0);
コード例 #5
0
ファイル: article.php プロジェクト: severnaya99/Sg-2010
$artbanner = $article->getBanner();
if ($artbanner == "") {
    $artbanner = " ";
}
$xoopsTpl->assign('articlebanner', $myts->displayTarea($artbanner, 1));
$showcomments = XOOPS_COMMENT_APPROVENONE != $xoopsModuleConfig['com_rule'] ? 1 : 0;
$allow_rating = $xoopsUser || $xoopsModuleConfig['anonymous_vote'] ? 1 : 0;
$xoopsTpl->assign('showcomments', $showcomments);
$xoopsTpl->assign('allow_rating', $allow_rating);
$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) {