Check for attachment ACP option.

This commit is contained in:
Ice
2008-08-11 11:00:03 +00:00
parent 80e424c63e
commit be7c59530a

View File

@@ -73,7 +73,7 @@ include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
// fetch post for news & announce // fetch post for news & announce
function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0) function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0)
{ {
global $db, $phpbb_root_path, $auth, $user, $bbcode_bitfield, $bbcode, $portal_config; global $db, $phpbb_root_path, $auth, $user, $bbcode_bitfield, $bbcode, $portal_config, $config;
$posts = array(); $posts = array();
@@ -254,6 +254,8 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
while ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
if( $config['allow_attachments'] )
{
// Pull attachment data // Pull attachment data
$sql2 = 'SELECT * $sql2 = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . ' FROM ' . ATTACHMENTS_TABLE . '
@@ -268,6 +270,7 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
$attachments[] = $row2; $attachments[] = $row2;
} }
$db->sql_freeresult($result2); $db->sql_freeresult($result2);
}
$posts[$i]['bbcode_uid'] = $row['bbcode_uid']; $posts[$i]['bbcode_uid'] = $row['bbcode_uid'];
$len_check = $row['post_text']; $len_check = $row['post_text'];