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 2164 2006-08-30 06:17:49Z chris $
| * $Id: syndication.php 3595 2008-01-09 00:10:57Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define("IGNORE_CLEAN_VARS", "fid");
|
define("NO_ONLINE", 1);
require_once "./global.php";
| define("NO_ONLINE", 1);
require_once "./global.php";
|
Zeile 49 | Zeile 49 |
---|
else { $forumlist = "";
|
else { $forumlist = "";
|
}
| }
|
// Get the forums the user is not allowed to see. $unviewable = get_unviewable_forums(); $inactiveforums = get_inactive_forums();
| // Get the forums the user is not allowed to see. $unviewable = get_unviewable_forums(); $inactiveforums = get_inactive_forums();
|
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();
|
| |
?>
| ?>
|