aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_attachments.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-10-30 16:20:11 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-10-30 16:20:11 +0000
commitc44f6ca080c944b57dc912de8708e5239c1543a2 (patch)
tree812e6cdb05ee83c0270f8d72d2e064adcb75064a /phpBB/includes/ucp/ucp_attachments.php
parent7e55e53d10702a9d8af8a70685801aa486fab3dc (diff)
downloadforums-c44f6ca080c944b57dc912de8708e5239c1543a2.tar
forums-c44f6ca080c944b57dc912de8708e5239c1543a2.tar.gz
forums-c44f6ca080c944b57dc912de8708e5239c1543a2.tar.bz2
forums-c44f6ca080c944b57dc912de8708e5239c1543a2.tar.xz
forums-c44f6ca080c944b57dc912de8708e5239c1543a2.zip
some fixes
git-svn-id: file:///svn/phpbb/trunk@6538 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_attachments.php')
-rw-r--r--phpBB/includes/ucp/ucp_attachments.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php
index 549e3a11b2..2312d1f30d 100644
--- a/phpBB/includes/ucp/ucp_attachments.php
+++ b/phpBB/includes/ucp/ucp_attachments.php
@@ -78,11 +78,17 @@ class ucp_attachments
$s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
+ if (!isset($sort_key_sql[$sort_key]))
+ {
+ $sort_key = 'a';
+ }
+
$order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
$sql = 'SELECT COUNT(attach_id) as num_attachments
FROM ' . ATTACHMENTS_TABLE . '
- WHERE poster_id = ' . $user->data['user_id'];
+ WHERE poster_id = ' . $user->data['user_id'] . '
+ AND is_orphan = 0';
$result = $db->sql_query($sql);
$num_attachments = $db->sql_fetchfield('num_attachments');
$db->sql_freeresult($result);
@@ -92,6 +98,7 @@ class ucp_attachments
LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id AND a.in_message = 0)
LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id AND a.in_message = 1)
WHERE a.poster_id = ' . $user->data['user_id'] . "
+ AND a.is_orphan = 0
ORDER BY $order_by";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);