コード例 #1
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";
コード例 #2
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';