aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-10-22 13:32:33 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-10-22 13:32:33 +0000
commit22129be21f3d08a27681e0ac6ba8ad401ed8ba96 (patch)
tree95b2aba768ebb29a024f96a804d9e4291b286d12 /phpBB/search.php
parent44ea780de626a450e17154e5154f3becbd512476 (diff)
downloadforums-22129be21f3d08a27681e0ac6ba8ad401ed8ba96.tar
forums-22129be21f3d08a27681e0ac6ba8ad401ed8ba96.tar.gz
forums-22129be21f3d08a27681e0ac6ba8ad401ed8ba96.tar.bz2
forums-22129be21f3d08a27681e0ac6ba8ad401ed8ba96.tar.xz
forums-22129be21f3d08a27681e0ac6ba8ad401ed8ba96.zip
- now username changes should work as desired
- removed some extract() calls git-svn-id: file:///svn/phpbb/trunk@6517 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/search.php')
-rw-r--r--phpBB/search.php35
1 files changed, 21 insertions, 14 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index 73c363bcc6..5418f34c6b 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -623,7 +623,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Does this post have an attachment? If so, add it to the list
if ($row['post_attachment'] && $config['allow_attachments'])
{
- $attach_list[] = $row['post_id'];
+ $attach_list[$row['forum_id']][] = $row['post_id'];
}
}
}
@@ -639,25 +639,32 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Pull attachment data
if (sizeof($attach_list))
{
- if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id))
+ $use_attach_list = $attach_list;
+ $attach_list = array();
+
+ foreach ($use_attach_list as $forum_id => $_list)
{
- $sql = 'SELECT *
- FROM ' . ATTACHMENTS_TABLE . '
- WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . '
- AND in_message = 0
- ORDER BY filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
+ if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id))
{
- $attachments[$row['post_msg_id']][] = $row;
+ $attach_list = array_merge($attach_list, $_list);
}
- $db->sql_freeresult($result);
}
- else
+ }
+
+ if (sizeof($attach_list))
+ {
+ $sql = 'SELECT *
+ FROM ' . ATTACHMENTS_TABLE . '
+ WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . '
+ AND in_message = 0
+ ORDER BY filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
{
- $display_notice = true;
+ $attachments[$row['post_msg_id']][] = $row;
}
+ $db->sql_freeresult($result);
}
}