Vergleich syndication.php - 1.6.9 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 13Zeile 13
define("IGNORE_CLEAN_VARS", "fid");
define("NO_ONLINE", 1);
define('THIS_SCRIPT', 'syndication.php');

define("IGNORE_CLEAN_VARS", "fid");
define("NO_ONLINE", 1);
define('THIS_SCRIPT', 'syndication.php');

 

$templatelist = "postbit_attachments_attachment";


require_once "./global.php";

// Load global language phrases
$lang->load("syndication");


require_once "./global.php";

// Load global language phrases
$lang->load("syndication");





// Load syndication class.
require_once MYBB_ROOT."inc/class_feedgeneration.php";
$feedgenerator = new FeedGenerator();

// Load syndication class.
require_once MYBB_ROOT."inc/class_feedgeneration.php";
$feedgenerator = new FeedGenerator();

Zeile 32Zeile 34
if($thread_limit > 50)
{
$thread_limit = 50;

if($thread_limit > 50)
{
$thread_limit = 50;

}

}

else if(!$thread_limit || $thread_limit < 0)
{
$thread_limit = 20;

else if(!$thread_limit || $thread_limit < 0)
{
$thread_limit = 20;

Zeile 68Zeile 70

// If there are no forums to syndicate, syndicate all viewable.
if(!empty($forumlist))


// If there are no forums to syndicate, syndicate all viewable.
if(!empty($forumlist))

{

{

    $forum_ids = "'-1'";
foreach($forumlist as $fid)
{

    $forum_ids = "'-1'";
foreach($forumlist as $fid)
{

Zeile 121Zeile 123
	if($forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;

	if($forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $fid;

	}
}

	}
}

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 135Zeile 137
{
$items[$thread['tid']] = array(
"title" => $parser->parse_badwords($thread['subject']),

{
$items[$thread['tid']] = array(
"title" => $parser->parse_badwords($thread['subject']),

		"link" => $channel['link'].get_thread_link($thread['tid']),        

		"link" => $channel['link'].get_thread_link($thread['tid']),

		"date" => $thread['dateline'],
);


		"date" => $thread['dateline'],
);


Zeile 145Zeile 147
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 154Zeile 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']]);