mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 14:28:56 +00:00
Merge branch 'ticket/11271' into ticket/11271-develop
* ticket/11271: [ticket/11271] Add docblock of feed_generate_content( ) [ticket/11271] Fix tabs and use !empty( ) instead of count( ) [ticket/11271] Remove unnecessary inclusion of functions_display [ticket/11271] Typecast forum and topic id to integer [ticket/11271] Use absolute path for displaying inline attachments in feeds [ticket/11271] Changed executable bit. [ticket/11271] Formatting code and removing null assignment. [ticket/11271] Removing unnecessary database object [ticket/11271] Separated attachment fetching query [ticket/11271] Fetched feed attachments before loop. [ticket/11271] Removed in-line attachment comments properly. [ticket/11271] Displaying in-line attached images in ATOM feed. Conflicts: phpBB/feed.php
This commit is contained in:
commit
fd9366daf5
2 changed files with 21 additions and 13 deletions
|
@ -81,6 +81,14 @@ class helper
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate text content
|
* Generate text content
|
||||||
|
*
|
||||||
|
* @param string $content is feed text content
|
||||||
|
* @param string $uid is bbcode_uid
|
||||||
|
* @param string $bitfield is bbcode bitfield
|
||||||
|
* @param int $options bbcode flag options
|
||||||
|
* @param int $forum_id is the forum id
|
||||||
|
* @param array $post_attachments is an array containing the attachments and their respective info
|
||||||
|
* @return string the html content to be printed for the feed
|
||||||
*/
|
*/
|
||||||
public function generate_content($content, $uid, $bitfield, $options, $forum_id, $post_attachments)
|
public function generate_content($content, $uid, $bitfield, $options, $forum_id, $post_attachments)
|
||||||
{
|
{
|
||||||
|
@ -130,7 +138,7 @@ class helper
|
||||||
$content = preg_replace( '#<(script|iframe)([^[]+)\1>#siU', ' <strong>$1</strong> ', $content);
|
$content = preg_replace( '#<(script|iframe)([^[]+)\1>#siU', ' <strong>$1</strong> ', $content);
|
||||||
|
|
||||||
// Parse inline images to display with the feed
|
// Parse inline images to display with the feed
|
||||||
if (count($post_attachments) > 0)
|
if (!empty($post_attachments))
|
||||||
{
|
{
|
||||||
$update_count = array();
|
$update_count = array();
|
||||||
parse_attachments($forum_id, $content, $post_attachments, $update_count);
|
parse_attachments($forum_id, $content, $post_attachments, $update_count);
|
||||||
|
|
|
@ -53,13 +53,13 @@ abstract class post_base extends \phpbb\feed\base
|
||||||
function fetch_attachments()
|
function fetch_attachments()
|
||||||
{
|
{
|
||||||
$sql_array = array(
|
$sql_array = array(
|
||||||
'SELECT' => 'a.*',
|
'SELECT' => 'a.*',
|
||||||
'FROM' => array(
|
'FROM' => array(
|
||||||
ATTACHMENTS_TABLE => 'a'
|
ATTACHMENTS_TABLE => 'a'
|
||||||
),
|
),
|
||||||
'WHERE' => 'a.in_message = 0 ',
|
'WHERE' => 'a.in_message = 0 ',
|
||||||
'ORDER_BY' => 'a.filetime DESC, a.post_msg_id ASC'
|
'ORDER_BY' => 'a.filetime DESC, a.post_msg_id ASC',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($this->topic_id))
|
if (isset($this->topic_id))
|
||||||
{
|
{
|
||||||
|
@ -68,11 +68,11 @@ abstract class post_base extends \phpbb\feed\base
|
||||||
else if (isset($this->forum_id))
|
else if (isset($this->forum_id))
|
||||||
{
|
{
|
||||||
$sql_array['LEFT_JOIN'] = array(
|
$sql_array['LEFT_JOIN'] = array(
|
||||||
array(
|
array(
|
||||||
'FROM' => array(TOPICS_TABLE => 't'),
|
'FROM' => array(TOPICS_TABLE => 't'),
|
||||||
'ON' => 'a.topic_id = t.topic_id'
|
'ON' => 'a.topic_id = t.topic_id',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$sql_array['WHERE'] .= 'AND t.forum_id = ' . (int) $this->forum_id;
|
$sql_array['WHERE'] .= 'AND t.forum_id = ' . (int) $this->forum_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue