print_description_row(' <input type="button" value="' . $vbphrase['validate'] . '" onclick="js_check_all_option(this.form, 1);" class="button" title="' . $vbphrase['validate'] . '" /> <input type="button" value="' . $vbphrase['delete'] . '" onclick="js_check_all_option(this.form, -1);" class="button" title="' . $vbphrase['delete'] . '" /> <input type="button" value="' . $vbphrase['ignore'] . '" onclick="js_check_all_option(this.form, 0);" class="button" title="' . $vbphrase['ignore'] . '" /> ', 0, 2, 'thead', 'center'); } print_label_row($vbphrase['attachment'], '<b> ' . '<a href="../attachment.php?' . $vbulletin->session->vars['sessionurl'] . "attachmentid={$attachment['attachmentid']}&d={$attachment['dateline']}\" target=\"_blank\">" . htmlspecialchars_uni($attachment['filename']) . '</a></b>' . ' (' . vb_number_format($attachment['filesize'], 1, true) . ')'); $extension = strtolower(file_extension($attachment['filename'])); if ($extension == 'gif' or $extension == 'jpg' or $extension == 'jpe' or $extension == 'jpeg' or $extension == 'png' or $extension == 'bmp') { if ($attachment['hasthumbnail']) { print_label_row($vbphrase['thumbnail'], '<a href="../attachment.php?' . $vbulletin->session->vars['sessionurl'] . "attachmentid={$attachment['attachmentid']}&stc=1&d={$attachment['thumbnail_dateline']}\" target=\"_blank\"><img src=\"../attachment.php?" . $vbulletin->session->vars['sessionurl'] . "attachmentid={$attachment['attachmentid']}&thumb=1&d={$attachment['dateline']}\" border=\"0\" style=\"border: outset 1px #AAAAAA\" alt=\"\" /></a>"); } else { print_label_row($vbphrase['image'], '<img src="../attachment.php?' . $vbulletin->session->vars['sessionurl'] . "attachmentid={$attachment['attachmentid']}&d={$attachment['dateline']}\" border=\"0\" />"); } } print_label_row($vbphrase['posted_by'], iif($attachment['username'], $attachment['username'], $attachment['postusername']) . ' ' . construct_link_code($vbphrase['view_content'], $attachmultiple->fetch_content_url($attachment, '../'), 1)); print_label_row($vbphrase['action'], "\r\n\t\t\t<label for=\"val_{$attachment['attachmentid']}\"><input type=\"radio\" name=\"attachaction[{$attachment['attachmentid']}]\" value=\"1\" id=\"val_{$attachment['attachmentid']}\" tabindex=\"1\" />" . $vbphrase['validate'] . "</label>\r\n\t\t\t<label for=\"del_{$attachment['attachmentid']}\"><input type=\"radio\" name=\"attachaction[{$attachment['attachmentid']}]\" value=\"-1\" id=\"del_{$attachment['attachmentid']}\" tabindex=\"1\" />" . $vbphrase['delete'] . "</label>\r\n\t\t\t<label for=\"ign_{$attachment['attachmentid']}\"><input type=\"radio\" name=\"attachaction[{$attachment['attachmentid']}]\" value=\"0\" id=\"ign_{$attachment['attachmentid']}\" tabindex=\"1\" checked=\"checked\" />" . $vbphrase['ignore'] . "</label>\r\n\t\t", '', 'top', 'attachaction'); $done = true; } if (!$done) { print_description_row($vbphrase['no_attachments_awaiting_moderation']); print_table_footer(); } else { print_submit_row(); } } // ###################### Start do attachment moderation ####################### if ($_POST['do'] == 'doattachments') { $vbulletin->input->clean_array_gpc('p', array('attachaction' => TYPE_ARRAY_INT)); $deleteids = array(); $approvedids = array();
} print_table_break(); $largest = $db->query_read("\n\t\tSELECT\n\t\t\ta.attachmentid, a.dateline, a.contentid, a.counter, a.userid, a.filename, user.username\n\t\tFROM " . TABLE_PREFIX . "attachment AS a\n\t\tINNER JOIN " . TABLE_PREFIX . "filedata AS fd ON (a.filedataid = fd.filedataid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (a.userid = user.userid)\n\t\tWHERE a.contentid <> 0\n\t\tORDER BY fd.filesize DESC\n\t\tLIMIT 5\n\t"); $position = 0; print_table_header($vbphrase['five_largest_attachments'], 5); print_cells_row(array(' ', $vbphrase['filename'], $vbphrase['username'], $vbphrase['filesize'], ' '), 1); $attachmultiple = new vB_Attachment_Display_Multiple($vbulletin); $attachments = $attachmultiple->fetch_results("a.contentid <> 0", false, 0, 5, 'filesize'); foreach ($attachments as $attachment) { $position++; $cell = array(); $cell[] = $position . '.'; $cell[] = "<a href=\"../attachment.php?" . $vbulletin->session->vars['sessionurl'] . "attachmentid={$attachment['attachmentid']}&d={$attachment['dateline']}\">" . htmlspecialchars_uni($attachment['filename'], false) . "</a>"; $cell[] = iif($attachment['userid'], "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u={$attachment['userid']}\">{$attachment['username']}</a>", $attachment['username']); $cell[] = vb_number_format($attachment['filesize'], 1, true); $cell[] = '<span class="smallfont">' . construct_link_code($vbphrase['view_content'], $attachmultiple->fetch_content_url($attachment, '../'), true) . construct_link_code($vbphrase['edit'], "attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&attachmentid={$attachment['attachmentid']}") . construct_link_code($vbphrase['delete'], "attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&attachmentid={$attachment['attachmentid']}") . '</span>'; print_cells_row($cell); } print_table_break(); $content = array(); $largestuser = $db->query_read("\n\t\tSELECT COUNT(*) AS count, SUM(filesize) AS totalsize, user.userid, username\n\t\tFROM " . TABLE_PREFIX . "attachment AS a\n\t\tINNER JOIN " . TABLE_PREFIX . "filedata AS fd ON (a.filedataid = fd.filedataid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (a.userid = user.userid)\n\t\tGROUP BY a.userid\n\t\tHAVING totalsize > 0\n\t\tORDER BY totalsize DESC\n\t\tLIMIT 5\n\t"); $position = 0; print_table_header($vbphrase['five_users_most_attachment_space'], 5); print_cells_row(array(' ', $vbphrase['username'], $vbphrase['attachments'], $vbphrase['total_size'], ' '), 1); while ($thispop = $db->fetch_array($largestuser)) { $position++; $cell = array(); $cell[] = $position . '.'; $cell[] = "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u={$thispop['userid']}\">{$thispop['username']}</a>"; $cell[] = vb_number_format($thispop['count']); $cell[] = vb_number_format($thispop['totalsize'], 1, true);
print_table_header($vbphrase['five_largest_attachments'], 5); print_cells_row(array(' ', $vbphrase['filename'], $vbphrase['username'], $vbphrase['filesize'], ' '), 1); $attachmultiple = new vB_Attachment_Display_Multiple($vbulletin); $attachments = $attachmultiple->fetch_results("a.contentid <> 0", false, 0, 5, 'filesize'); foreach ($attachments AS $attachment) { $position++; $cell = array(); $cell[] = $position . '.'; $cell[] = "<a href=\"../attachment.php?" . $vbulletin->session->vars['sessionurl'] . "attachmentid=$attachment[attachmentid]&d=$attachment[dateline]\">$attachment[filename]</a>"; $cell[] = iif($attachment['userid'], "<a href=\"user.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&u=$attachment[userid]\">$attachment[username]</a>", $attachment['username']); $cell[] = vb_number_format($attachment['filesize'], 1, true); $cell[] = '<span class="smallfont">' . construct_link_code($vbphrase['view_content'], $attachmultiple->fetch_content_url($attachment, '../'), true) . construct_link_code($vbphrase['edit'], "attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&attachmentid=$attachment[attachmentid]") . construct_link_code($vbphrase['delete'], "attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=delete&attachmentid=$attachment[attachmentid]") . '</span>'; print_cells_row($cell); } print_table_break(); $content = array(); $largestuser = $db->query_read(" SELECT COUNT(*) AS count, SUM(filesize) AS totalsize, user.userid, username FROM " . TABLE_PREFIX . "attachment AS a INNER JOIN " . TABLE_PREFIX . "filedata AS fd ON (a.filedataid = fd.filedataid) LEFT JOIN " . TABLE_PREFIX . "user AS user ON (a.userid = user.userid) GROUP BY a.userid HAVING totalsize > 0