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); $list[$k]->topic = $topic; } if (!isset($list[$k]->body)) { $list[$k]->body = db_shift('select body from siteforum_post where id = ?', $list[$k]->id); }
loader_import('siteforum.Topic'); loader_import('siteforum.Filters'); loader_import('saf.GUI.Pager'); global $cgi; if (empty($cgi->post)) { header('Location: ' . site_prefix() . '/index/siteforum-topic-action?topic=' . $cgi->topic); exit; } if (!isset($cgi->offset) || !is_numeric($cgi->offset)) { $cgi->offset = 0; } $p = new SiteForum_Post(); $p->orderBy('ts asc'); $p->limit(appconf('limit')); $p->offset($cgi->offset); $list = $p->getThread($cgi->post); if (!empty($cgi->highlight)) { $highlight = '?highlight=' . $cgi->highlight; } else { $highlight = '?highlight='; } $pg = new Pager($cgi->offset, appconf('limit'), $p->total); $pg->setUrl(site_prefix() . '/index/siteforum-list-action/post.%s' . $highlight, $cgi->post); $pg->getInfo(); if (!$cgi->topic) { $cgi->topic = $list[0]->topic_id; } $t = new SiteForum_Topic(); $topic = $t->getTitle($cgi->topic); $subject = $list[0]->subject; if (!empty($cgi->highlight)) {