mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
#i53
git-svn-id: file:///svn/phpbb/trunk@8113 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
cb85c2c57c
commit
b2afdc0704
4 changed files with 41 additions and 3 deletions
|
@ -1539,6 +1539,23 @@ class acp_users
|
||||||
$sort_key = request_var('sk', 'a');
|
$sort_key = request_var('sk', 'a');
|
||||||
$sort_dir = request_var('sd', 'd');
|
$sort_dir = request_var('sd', 'd');
|
||||||
|
|
||||||
|
if ($deletemark && sizeof($marked))
|
||||||
|
{
|
||||||
|
$sql = 'SELECT attach_id
|
||||||
|
FROM ' . ATTACHMENTS_TABLE . '
|
||||||
|
WHERE poster_id = ' . $user_id . '
|
||||||
|
AND is_orphan = 0
|
||||||
|
AND ' . $db->sql_in_set('attach_id', $marked);
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$marked = array();
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$marked[] = $row['attach_id'];
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
if ($deletemark && sizeof($marked))
|
if ($deletemark && sizeof($marked))
|
||||||
{
|
{
|
||||||
if (confirm_box(true))
|
if (confirm_box(true))
|
||||||
|
@ -1603,7 +1620,8 @@ class acp_users
|
||||||
|
|
||||||
$sql = 'SELECT COUNT(attach_id) as num_attachments
|
$sql = 'SELECT COUNT(attach_id) as num_attachments
|
||||||
FROM ' . ATTACHMENTS_TABLE . "
|
FROM ' . ATTACHMENTS_TABLE . "
|
||||||
WHERE poster_id = $user_id";
|
WHERE poster_id = $user_id
|
||||||
|
AND is_orphan = 0";
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
$num_attachments = (int) $db->sql_fetchfield('num_attachments');
|
$num_attachments = (int) $db->sql_fetchfield('num_attachments');
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
@ -1615,6 +1633,7 @@ class acp_users
|
||||||
LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id
|
LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id
|
||||||
AND a.in_message = 1)
|
AND a.in_message = 1)
|
||||||
WHERE a.poster_id = ' . $user_id . "
|
WHERE a.poster_id = ' . $user_id . "
|
||||||
|
AND a.is_orphan = 0
|
||||||
ORDER BY $order_by";
|
ORDER BY $order_by";
|
||||||
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
|
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
|
||||||
|
|
||||||
|
|
|
@ -790,7 +790,7 @@ function delete_attachments($mode, $ids, $resync = true)
|
||||||
{
|
{
|
||||||
global $db, $config;
|
global $db, $config;
|
||||||
|
|
||||||
if (is_array($ids))
|
if (is_array($ids) && sizeof($ids))
|
||||||
{
|
{
|
||||||
$ids = array_unique($ids);
|
$ids = array_unique($ids);
|
||||||
$ids = array_map('intval', $ids);
|
$ids = array_map('intval', $ids);
|
||||||
|
|
|
@ -29,6 +29,24 @@ class ucp_attachments
|
||||||
$confirm = (isset($_POST['confirm'])) ? true : false;
|
$confirm = (isset($_POST['confirm'])) ? true : false;
|
||||||
$delete_ids = array_keys(request_var('attachment', array(0)));
|
$delete_ids = array_keys(request_var('attachment', array(0)));
|
||||||
|
|
||||||
|
if ($delete && sizeof($delete_ids))
|
||||||
|
{
|
||||||
|
// Validate $delete_ids...
|
||||||
|
$sql = 'SELECT attach_id
|
||||||
|
FROM ' . ATTACHMENTS_TABLE . '
|
||||||
|
WHERE poster_id = ' . $user->data['user_id'] . '
|
||||||
|
AND is_orphan = 0
|
||||||
|
AND ' . $db->sql_in_set('attach_id', $delete_ids);
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$delete_ids = array();
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$delete_ids[] = $row['attach_id'];
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
|
||||||
if ($delete && sizeof($delete_ids))
|
if ($delete && sizeof($delete_ids))
|
||||||
{
|
{
|
||||||
$s_hidden_fields = array(
|
$s_hidden_fields = array(
|
||||||
|
@ -46,6 +64,7 @@ class ucp_attachments
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_attachments('attach', $delete_ids);
|
delete_attachments('attach', $delete_ids);
|
||||||
|
|
||||||
meta_refresh(3, $this->u_action);
|
meta_refresh(3, $this->u_action);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<li class="row<!-- IF attachrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
|
<li class="row<!-- IF attachrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
|
||||||
<dl>
|
<dl>
|
||||||
<dt><a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle">{attachrow.FILENAME}</a><br />
|
<dt><a href="{attachrow.U_VIEW_ATTACHMENT}" class="topictitle">{attachrow.FILENAME}</a><br />
|
||||||
{L_TOPIC}: <a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></dt>
|
<!-- IF attachrow.S_IN_MESSAGE -->{L_PM}: <!-- ELSE -->{L_TOPIC}: <!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></dt>
|
||||||
<dd class="extra">{attachrow.DOWNLOAD_COUNT}</dd>
|
<dd class="extra">{attachrow.DOWNLOAD_COUNT}</dd>
|
||||||
<dd class="extra">{attachrow.SIZE}</dd>
|
<dd class="extra">{attachrow.SIZE}</dd>
|
||||||
<dd class="time"><span>{attachrow.POST_TIME}</span></dd>
|
<dd class="time"><span>{attachrow.POST_TIME}</span></dd>
|
||||||
|
|
Loading…
Add table
Reference in a new issue