Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: syndication.php 5125 2010-07-27 07:28:03Z RyanGordon $
| * $Id$
|
*/
define("IN_MYBB", 1); define("IGNORE_CLEAN_VARS", "fid"); define("NO_ONLINE", 1); define('THIS_SCRIPT', 'syndication.php');
|
*/
define("IN_MYBB", 1); define("IGNORE_CLEAN_VARS", "fid"); define("NO_ONLINE", 1); define('THIS_SCRIPT', 'syndication.php');
|
| $templatelist = "postbit_attachments_attachment";
|
require_once "./global.php";
| require_once "./global.php";
|
Zeile 47 | Zeile 49 |
---|
else { $forumlist = "";
|
else { $forumlist = "";
|
}
| }
|
// Get the forums the user is not allowed to see. $unviewableforums = get_unviewable_forums(true); $inactiveforums = get_inactive_forums();
| // Get the forums the user is not allowed to see. $unviewableforums = get_unviewable_forums(true); $inactiveforums = get_inactive_forums();
|
Zeile 125 | Zeile 127 |
---|
} if(!empty($onlyusfids)) {
|
} if(!empty($onlyusfids)) {
|
$permsql .= "AND (fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}')";
| $permsql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))";
|
}
// Get the threads to syndicate.
| }
// Get the threads to syndicate.
|
Zeile 133 | Zeile 135 |
---|
// Loop through all the threads. while($thread = $db->fetch_array($query)) {
|
// Loop through all the threads. while($thread = $db->fetch_array($query)) {
|
$items[$thread['tid']] = array( "title" => $thread['subject'], "link" => $channel['link'].get_thread_link($thread['tid']), "date" => $thread['dateline'], ); $firstposts[] = $thread['firstpost'];
| $items[$thread['tid']] = array( "title" => $parser->parse_badwords($thread['subject']), "link" => $channel['link'].get_thread_link($thread['tid']), "date" => $thread['dateline'], );
$firstposts[] = $thread['firstpost'];
|
}
if(!empty($firstposts)) { $firstpostlist = "pid IN(".$db->escape_string(implode(',', $firstposts)).")";
|
}
if(!empty($firstposts)) { $firstpostlist = "pid IN(".$db->escape_string(implode(',', $firstposts)).")";
|
$query = $db->simple_select("posts", "message, edittime, tid, fid, pid", $firstpostlist, array('order_by' => 'dateline', 'order_dir' => 'desc'));
| $attachments = array(); $query = $db->simple_select("attachments", "*", $firstpostlist); while($attachment = $db->fetch_array($query)) { if(!isset($attachments[$attachment['pid']])) { $attachments[$attachment['pid']] = array(); } $attachments[$attachment['pid']][] = $attachment; }
$query = $db->simple_select("posts", "message, edittime, tid, fid, pid", $firstpostlist, array('order_by' => 'dateline', 'order_dir' => 'desc'));
|
while($post = $db->fetch_array($query)) { $parser_options = array(
| while($post = $db->fetch_array($query)) { $parser_options = array(
|
Zeile 154 | Zeile 168 |
---|
"allow_smilies" => $forumcache[$post['fid']]['allowsmilies'], "allow_imgcode" => $forumcache[$post['fid']]['allowimgcode'], "allow_videocode" => $forumcache[$post['fid']]['allowvideocode'],
|
"allow_smilies" => $forumcache[$post['fid']]['allowsmilies'], "allow_imgcode" => $forumcache[$post['fid']]['allowimgcode'], "allow_videocode" => $forumcache[$post['fid']]['allowvideocode'],
|
"filter_badwords" => 1
| "filter_badwords" => 1, "filter_cdata" => 1
|
);
|
);
|
|
|
$parsed_message = $parser->parse_message($post['message'], $parser_options);
|
$parsed_message = $parser->parse_message($post['message'], $parser_options);
|
$query2 = $db->simple_select("attachments", "*", "pid=".$post['pid']); while($attachment = $db->fetch_array($query2))
| if(isset($attachments[$post['pid']]) && is_array($attachments[$post['pid']]))
|
{
|
{
|
$ext = get_extension($attachment['filename']); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']); $attachment['filesize'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon($ext); eval("\$attbit = \"".$templates->get("postbit_attachments_attachment")."\";"); if(stripos($parsed_message, "[attachment=".$attachment['aid']."]") !== false)
| foreach($attachments[$post['pid']] as $attachment)
|
{
|
{
|
$parsed_message = preg_replace("#\[attachment=".$attachment['aid']."]#si", $attbit, $parsed_message); } else { $parsed_message .= "<br />".$attbit;
| $ext = get_extension($attachment['filename']); $attachment['filename'] = htmlspecialchars_uni($attachment['filename']); $attachment['filesize'] = get_friendly_size($attachment['filesize']); $attachment['icon'] = get_attachment_icon($ext); eval("\$attbit = \"".$templates->get("postbit_attachments_attachment")."\";"); if(stripos($parsed_message, "[attachment=".$attachment['aid']."]") !== false) { $parsed_message = preg_replace("#\[attachment=".$attachment['aid']."]#si", $attbit, $parsed_message); } else { $parsed_message .= "<br />".$attbit; }
|
} }
|
} }
|
|
|
$items[$post['tid']]['description'] = $parsed_message; $items[$post['tid']]['updated'] = $post['edittime']; $feedgenerator->add_item($items[$post['tid']]);
| $items[$post['tid']]['description'] = $parsed_message; $items[$post['tid']]['updated'] = $post['edittime']; $feedgenerator->add_item($items[$post['tid']]);
|