示例#1
0
global $cgi;
loader_import('siteforum.Post');
loader_import('siteforum.Filters');
$p = new SiteForum_Post();
global $cgi;
if (!isset($cgi->limit)) {
    $cgi->limit = 10;
}
if (isset($parameters['topic'])) {
    $list = $p->getLatest($cgi->limit, $parameters['topic']);
    $topic = db_shift('select name from siteforum_topic where id = ?', $parameters['topic']);
    $title = appconf('rss_title') . ': ' . $topic;
} elseif (isset($parameters['threads'])) {
    $p->limit = $cgi->limit;
    $list = $p->getThreads($parameters['threads']);
    $topic = db_shift('select name from siteforum_topic where id = ?', $parameters['threads']);
    $title = appconf('rss_title') . ': ' . $topic;
} elseif (isset($parameters['thread'])) {
    $p->limit = $cgi->limit;
    $list = $p->getThread($parameters['thread'], true);
    $title = appconf('rss_title') . ': ' . db_shift('select subject from siteforum_post where id = ? and post_id = 0', $parameters['thread']);
} else {
    $list = $p->getLatest($cgi->limit);
    $title = appconf('rss_title') . ': ' . intl_get('Latest Postings');
}
foreach (array_keys($list) as $k) {
    if (!empty($topic)) {
        $list[$k]->topic = $topic;
    } else {
        $topic = db_shift('select name from siteforum_topic where id = ?', $list[$k]->topic_id);
示例#2
0
<?php

loader_import('siteforum.Post');
loader_import('siteforum.Topic');
loader_import('siteforum.Filters');
loader_import('saf.GUI.Pager');
global $cgi;
if (empty($cgi->topic)) {
    header('Location: ' . site_prefix() . '/index/siteforum-app');
    exit;
}
if (!isset($cgi->offset) || !is_numeric($cgi->offset)) {
    $cgi->offset = 0;
}
$p = new SiteForum_Post();
$p->limit(appconf('limit'));
$p->offset($cgi->offset);
$list = $p->getThreads($cgi->topic);
$pg = new Pager($cgi->offset, appconf('limit'), $p->total);
$pg->setUrl(site_prefix() . '/index/siteforum-topic-action?topic=%s', $cgi->topic);
$pg->getInfo();
$t = new SiteForum_Topic();
$topic = $t->getTitle($cgi->topic);
page_title($topic);
template_simple_register('pager', $pg);
echo template_simple('thread_list.spt', array('forum_name' => appconf('forum_name'), 'topic' => $topic, 'list' => $list, 'sitesearch' => @file_exists('inc/app/sitesearch/data/sitesearch.pid')));
if (appconf('template')) {
    page_template(appconf('template'));
}