Zeile 3 | Zeile 3 |
---|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html
| * Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html
|
*
|
*
|
* $Id: syndication.php 2226 2006-09-16 05:47:25Z chris $
| * $Id: syndication.php 3524 2007-12-01 06:59:40Z chris $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 58 | Zeile 58 |
---|
// If there are any, add SQL to exclude them. if($unviewable) {
|
// If there are any, add SQL to exclude them. if($unviewable) {
|
$unviewable = "AND f.fid NOT IN($unviewable)";
| $unviewable = "AND fid NOT IN($unviewable)";
|
} if($inactiveforums) {
|
} if($inactiveforums) {
|
$unviewable .= " AND f.fid NOT IN($inactiveforums)";
| $unviewable .= " AND fid NOT IN($inactiveforums)";
|
}
// If there are no forums to syndicate, syndicate all viewable.
| }
// If there are no forums to syndicate, syndicate all viewable.
|
Zeile 73 | Zeile 73 |
---|
{ $forum_ids .= ",'".intval($fid)."'"; }
|
{ $forum_ids .= ",'".intval($fid)."'"; }
|
$forumlist = "AND f.fid IN ($forum_ids) $unviewable";
| $forumlist = "AND fid IN ($forum_ids) $unviewable";
|
} else {
| } else {
|
Zeile 83 | Zeile 83 |
---|
// Find out which title to add to the feed. $title = $mybb->settings['bbname'];
|
// Find out which title to add to the feed. $title = $mybb->settings['bbname'];
|
$query = $db->simple_select(TABLE_PREFIX."forums f", "f.name, f.fid", "1=1 ".$forumlist);
| $query = $db->simple_select(TABLE_PREFIX."forums", "name, fid", "1=1 ".$forumlist);
|
$comma = " - "; while($forum = $db->fetch_array($query)) {
| $comma = " - "; while($forum = $db->fetch_array($query)) {
|
Zeile 97 | Zeile 97 |
---|
{ $title = $mybb->settings['bbname']." - ".$lang->all_forums; }
|
{ $title = $mybb->settings['bbname']." - ".$lang->all_forums; }
|
// Get the threads to syndicate. $query = $db->query(" SELECT t.*, f.name AS forumname, p.message AS postmessage FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid) LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=t.firstpost) WHERE t.visible=1 AND t.closed NOT LIKE 'moved|%' ".$forumlist." ORDER BY t.dateline DESC LIMIT 0, ".$thread_limit );
| |
// Set the feed type. $feedgenerator->set_feed_format($mybb->input['type']);
| // Set the feed type. $feedgenerator->set_feed_format($mybb->input['type']);
|
Zeile 121 | Zeile 110 |
---|
); $feedgenerator->set_channel($channel);
|
); $feedgenerator->set_channel($channel);
|
| // Get the threads to syndicate. $query = $db->simple_select(TABLE_PREFIX."threads", "subject, tid, dateline, firstpost", "visible='1' AND closed NOT LIKE 'moved|%' ".$forumlist, array('order_by' => 'dateline', 'order_dir' => 'DESC', 'limit' => $thread_limit));
|
// Loop through all the threads. while($thread = $db->fetch_array($query)) {
|
// Loop through all the threads. while($thread = $db->fetch_array($query)) {
|
$item = array(
| $items[$thread['tid']] = array(
|
"title" => $thread['subject'],
|
"title" => $thread['subject'],
|
"link" => $mybb->settings['bburl']."/showthread.php?tid=".$thread['tid'], "description" => $parser->strip_mycode($thread['postmessage'], $parser_options), "date" => $thread['dateline']
| "link" => $mybb->settings['bburl']."/showthread.php?tid=".$thread['tid'], "date" => $thread['dateline'],
|
);
|
);
|
$feedgenerator->add_item($item);
| $firstposts[] = $thread['firstpost']; }
if(!empty($firstposts)) { $firstpostlist = "pid IN(".implode(',', $firstposts).")"; $query = $db->simple_select(TABLE_PREFIX."posts", "message, edittime, tid", $firstpostlist, array('order_by' => 'dateline', 'order_dir' => 'desc')); while($post = $db->fetch_array($query)) { $items[$post['tid']]['description'] = $parser->strip_mycode($post['message'], $parser_options); $items[$post['tid']]['updated'] = $post['edittime']; $feedgenerator->add_item($items[$post['tid']]); }
|
}
// Then output the feed XML. $feedgenerator->output_feed();
|
}
// Then output the feed XML. $feedgenerator->output_feed();
|
| |
?>
| ?>
|