Zeile 187 | Zeile 187 |
---|
{ case "pgsql": $query = $db->query("
|
{ case "pgsql": $query = $db->query("
|
SELECT a.*, u.uid AS useruid, u.username, SUM(a.filesize) as totalsize
| SELECT a.uid, u.username, SUM(a.filesize) as totalsize
|
FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
|
FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
|
GROUP BY ".$db->build_fields_string("attachments", "a.").",u.uid,u.username
| GROUP BY a.uid, u.username
|
ORDER BY totalsize DESC LIMIT 5 "); break; default: $query = $db->query("
|
ORDER BY totalsize DESC LIMIT 5 "); break; default: $query = $db->query("
|
SELECT a.*, u.uid AS useruid, u.username, SUM(a.filesize) as totalsize
| SELECT a.uid, u.username, SUM(a.filesize) as totalsize
|
FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid) GROUP BY a.uid
| FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid) GROUP BY a.uid
|
Zeile 207 | Zeile 207 |
---|
} while($user = $db->fetch_array($query)) {
|
} while($user = $db->fetch_array($query)) {
|
if(!$user['useruid'])
| if(!$user['uid'])
|
{ $user['username'] = $lang->na; }
|
{ $user['username'] = $lang->na; }
|
$table->construct_cell(build_profile_link($user['username'], $user['useruid'], "_blank"));
| $table->construct_cell(build_profile_link(htmlspecialchars_uni($user['username']), $user['uid'], "_blank"));
|
$table->construct_cell("<a href=\"index.php?module=forum-attachments&results=1&username=".urlencode($user['username'])."\" target=\"_blank\">".get_friendly_size($user['totalsize'])."</a>", array('class' => 'align_center')); $table->construct_row(); }
| $table->construct_cell("<a href=\"index.php?module=forum-attachments&results=1&username=".urlencode($user['username'])."\" target=\"_blank\">".get_friendly_size($user['totalsize'])."</a>", array('class' => 'align_center')); $table->construct_row(); }
|
Zeile 223 | Zeile 223 |
---|
if($mybb->input['action'] == "delete_orphans" && $mybb->request_method == "post") { $plugins->run_hooks("admin_forum_attachments_delete_orphans");
|
if($mybb->input['action'] == "delete_orphans" && $mybb->request_method == "post") { $plugins->run_hooks("admin_forum_attachments_delete_orphans");
|
| $success_count = $error_count = 0;
|
// Deleting specific attachments from uploads directory if(is_array($mybb->input['orphaned_files']))
| // Deleting specific attachments from uploads directory if(is_array($mybb->input['orphaned_files']))
|
Zeile 240 | Zeile 242 |
---|
foreach($mybb->input['orphaned_files'] as $file) { if(!@unlink(MYBB_ROOT.$mybb->settings['uploadspath']."/".$file))
|
foreach($mybb->input['orphaned_files'] as $file) { if(!@unlink(MYBB_ROOT.$mybb->settings['uploadspath']."/".$file))
|
{ $error = true; } }
| { $error_count++; } else { $success_count++; } }
|
}
// Deleting physical attachments which exist in database
| }
// Deleting physical attachments which exist in database
|
Zeile 256 | Zeile 262 |
---|
while($attachment = $db->fetch_array($query)) { if(!$attachment['pid'])
|
while($attachment = $db->fetch_array($query)) { if(!$attachment['pid'])
|
{
| {
|
remove_attachment(null, $attachment['posthash'], $attachment['aid']); } else { remove_attachment($attachment['pid'], null, $attachment['aid']); }
|
remove_attachment(null, $attachment['posthash'], $attachment['aid']); } else { remove_attachment($attachment['pid'], null, $attachment['aid']); }
|
| $success_count++;
|
} }
| } }
|
Zeile 271 | Zeile 278 |
---|
// Log admin action log_admin_action();
|
// Log admin action log_admin_action();
|
if($error == true)
| $message = ''; $status = 'success'; if($error_count > 0)
|
{
|
{
|
flash_message($lang->error_not_all_removed, 'error');
| $status = 'error'; $message = $lang->sprintf($lang->error_count, $error_count);
|
}
|
}
|
else
| if($success_count > 0)
|
{
|
{
|
flash_message($lang->success_orphan_deleted, 'success');
| if($error_count > 0) { $message .= '<br />'.$lang->sprintf($lang->success_count, $success_count); } else { $message = $lang->success_orphan_deleted; }
|
}
|
}
|
admin_redirect("index.php?module=forum-attachments");
| flash_message($message, $status); admin_redirect('index.php?module=forum-attachments');
|
}
if($mybb->input['action'] == "orphans")
| }
if($mybb->input['action'] == "orphans")
|
Zeile 848 | Zeile 867 |
---|
$form_container->output_row($lang->name_contains, $lang->name_contains_desc, $form->generate_text_box('filename', $mybb->input['filename'], array('id' => 'filename')), 'filename'); $form_container->output_row($lang->type_contains, "", $form->generate_text_box('mimetype', $mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype'); $form_container->output_row($lang->forum_is, "", $form->generate_forum_select('forum[]', $mybb->input['forum'], array('multiple' => true, 'size' => 5, 'id' => 'forum')), 'forum');
|
$form_container->output_row($lang->name_contains, $lang->name_contains_desc, $form->generate_text_box('filename', $mybb->input['filename'], array('id' => 'filename')), 'filename'); $form_container->output_row($lang->type_contains, "", $form->generate_text_box('mimetype', $mybb->input['mimetype'], array('id' => 'mimetype')), 'mimetype'); $form_container->output_row($lang->forum_is, "", $form->generate_forum_select('forum[]', $mybb->input['forum'], array('multiple' => true, 'size' => 5, 'id' => 'forum')), 'forum');
|
$form_container->output_row($lang->username_is, "", $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');
| $form_container->output_row($lang->username_is, "", $form->generate_text_box('username', htmlspecialchars_uni($mybb->get_input('username')), array('id' => 'username')), 'username');
|
$more_options = array( "less_than" => $lang->more_than,
| $more_options = array( "less_than" => $lang->more_than,
|
Zeile 945 | Zeile 964 |
---|
if($attachment['user_username']) {
|
if($attachment['user_username']) {
|
$attachment['username'] = $attachment['username'];
| $attachment['username'] = $attachment['user_username'];
|
}
|
}
|
$table->construct_cell(build_profile_link($attachment['username'], $attachment['uid'], "_blank"), array("class" => "align_center"));
| $table->construct_cell(build_profile_link(htmlspecialchars_uni($attachment['username']), $attachment['uid'], "_blank"), array("class" => "align_center"));
|
$table->construct_cell("<a href=\"../".get_post_link($attachment['pid'])."\" target=\"_blank\">".htmlspecialchars_uni($attachment['subject'])."</a>", array("class" => "align_center")); $table->construct_cell(my_number_format($attachment['downloads']), array("class" => "align_center")); if($attachment['dateuploaded'] > 0)
| $table->construct_cell("<a href=\"../".get_post_link($attachment['pid'])."\" target=\"_blank\">".htmlspecialchars_uni($attachment['subject'])."</a>", array("class" => "align_center")); $table->construct_cell(my_number_format($attachment['downloads']), array("class" => "align_center")); if($attachment['dateuploaded'] > 0)
|