mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge branch '3.2.x'
This commit is contained in:
commit
7c141954bf
2 changed files with 96 additions and 34 deletions
|
@ -329,42 +329,71 @@
|
||||||
<fieldset class="tabulated">
|
<fieldset class="tabulated">
|
||||||
<legend>{L_TITLE}</legend>
|
<legend>{L_TITLE}</legend>
|
||||||
|
|
||||||
<table class="table1 zebra-table fixed-width-table">
|
<div class="pagination top-pagination">
|
||||||
<thead>
|
<!-- IF .pagination or TOTAL_FILES -->
|
||||||
<tr>
|
{L_NUMBER_FILES}{L_COLON} {TOTAL_FILES} • {L_TOTAL_SIZE}{L_COLON} {TOTAL_SIZE}
|
||||||
<th>{L_FILENAME}</th>
|
<!-- IF .pagination -->
|
||||||
<th style="width: 15%;">{L_FILEDATE}</th>
|
• <!-- INCLUDE pagination.html -->
|
||||||
<th style="width: 15%;">{L_FILESIZE}</th>
|
<!-- ELSE -->
|
||||||
<th style="width: 15%;">{L_ATTACH_POST_ID}</th>
|
• {PAGE_NUMBER}
|
||||||
<th style="width: 15%;">{L_ATTACH_TO_POST}</th>
|
<!-- ENDIF -->
|
||||||
<th style="width: 15%;">{L_DELETE}</th>
|
<!-- ENDIF -->
|
||||||
</tr>
|
</div>
|
||||||
</thead>
|
|
||||||
<tbody>
|
<!-- IF .orphan -->
|
||||||
<!-- BEGIN orphan -->
|
<table class="table1 zebra-table fixed-width-table">
|
||||||
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td>
|
<th>{L_FILENAME}</th>
|
||||||
<td>{orphan.FILETIME}</td>
|
<th style="width: 15%;">{L_FILEDATE}</th>
|
||||||
<td>{orphan.FILESIZE}</td>
|
<th style="width: 15%;">{L_FILESIZE}</th>
|
||||||
<td><strong>{L_ATTACH_ID}{L_COLON} </strong><input type="number" min="0" max="9999999999" name="post_id[{orphan.ATTACH_ID}]" value="{orphan.POST_ID}" style="width: 75%;" /></td>
|
<th style="width: 15%;">{L_ATTACH_POST_ID}</th>
|
||||||
<td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td>
|
<th style="width: 15%;">{L_ATTACH_TO_POST}</th>
|
||||||
<td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td>
|
<th style="width: 15%;">{L_DELETE}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END orphan -->
|
</thead>
|
||||||
<tr class="row4">
|
<tbody>
|
||||||
<td colspan="4"> </td>
|
<!-- BEGIN orphan -->
|
||||||
<td class="small"><a href="#" onclick="marklist('orphan', 'add', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'add', false); return false;">{L_UNMARK_ALL}</a></td>
|
<tr>
|
||||||
<td class="small"><a href="#" onclick="marklist('orphan', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'delete', false); return false;">{L_UNMARK_ALL}</a></td>
|
<td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td>
|
||||||
</tr>
|
<td>{orphan.FILETIME}</td>
|
||||||
</tbody>
|
<td>{orphan.FILESIZE}</td>
|
||||||
</table>
|
<td><strong>{L_ATTACH_ID}{L_COLON} </strong><input type="number" min="0" max="9999999999" name="post_id[{orphan.ATTACH_ID}]" value="{orphan.POST_ID}" style="width: 75%;" /></td>
|
||||||
|
<td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td>
|
||||||
|
<td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td>
|
||||||
|
</tr>
|
||||||
|
<!-- END orphan -->
|
||||||
|
<tr class="row4">
|
||||||
|
<td colspan="4"> </td>
|
||||||
|
<td class="small"><a href="#" onclick="marklist('orphan', 'add', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'add', false); return false;">{L_UNMARK_ALL}</a></td>
|
||||||
|
<td class="small"><a href="#" onclick="marklist('orphan', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('orphan', 'delete', false); return false;">{L_UNMARK_ALL}</a></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!-- ELSE -->
|
||||||
|
<div class="errorbox">
|
||||||
|
<p>{L_NO_ATTACHMENTS}</p>
|
||||||
|
</div>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<br />
|
<!-- IF TOTAL_FILES -->
|
||||||
|
<div class="pagination">
|
||||||
|
{L_NUMBER_FILES}{L_COLON} {TOTAL_FILES} • {L_TOTAL_SIZE}{L_COLON} {TOTAL_SIZE}
|
||||||
|
<!-- IF .pagination -->
|
||||||
|
• <!-- INCLUDE pagination.html -->
|
||||||
|
<!-- ELSE -->
|
||||||
|
• {PAGE_NUMBER}
|
||||||
|
<!-- ENDIF -->
|
||||||
|
</div>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- IF .orphan -->
|
||||||
|
<p class="submit-buttons">
|
||||||
|
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
||||||
|
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||||
|
</p>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<p class="submit-buttons">
|
|
||||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
|
||||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
|
||||||
</p>
|
|
||||||
{S_FORM_TOKEN}
|
{S_FORM_TOKEN}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -922,6 +922,9 @@ class acp_attachments
|
||||||
|
|
||||||
case 'orphan':
|
case 'orphan':
|
||||||
|
|
||||||
|
/* @var $pagination \phpbb\pagination */
|
||||||
|
$pagination = $this->phpbb_container->get('pagination');
|
||||||
|
|
||||||
if ($submit)
|
if ($submit)
|
||||||
{
|
{
|
||||||
$delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array();
|
$delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array();
|
||||||
|
@ -1064,13 +1067,29 @@ class acp_attachments
|
||||||
'S_ORPHAN' => true)
|
'S_ORPHAN' => true)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$attachments_per_page = (int) $config['topics_per_page'];
|
||||||
|
|
||||||
|
// Get total number or orphans older than 3 hours
|
||||||
|
$sql = 'SELECT COUNT(attach_id) as num_files, SUM(filesize) as total_size
|
||||||
|
FROM ' . ATTACHMENTS_TABLE . '
|
||||||
|
WHERE is_orphan = 1
|
||||||
|
AND filetime < ' . (time() - 3*60*60);
|
||||||
|
$result = $this->db->sql_query($sql);
|
||||||
|
$row = $this->db->sql_fetchrow($result);
|
||||||
|
$num_files = (int) $row['num_files'];
|
||||||
|
$total_size = (int) $row['total_size'];
|
||||||
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$start = $request->variable('start', 0);
|
||||||
|
$start = $pagination->validate_start($start, $attachments_per_page, $num_files);
|
||||||
|
|
||||||
// Just get the files with is_orphan set and older than 3 hours
|
// Just get the files with is_orphan set and older than 3 hours
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . ATTACHMENTS_TABLE . '
|
FROM ' . ATTACHMENTS_TABLE . '
|
||||||
WHERE is_orphan = 1
|
WHERE is_orphan = 1
|
||||||
AND filetime < ' . (time() - 3*60*60) . '
|
AND filetime < ' . (time() - 3*60*60) . '
|
||||||
ORDER BY filetime DESC';
|
ORDER BY filetime DESC';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query_limit($sql, $attachments_per_page, $start);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
|
@ -1086,6 +1105,20 @@ class acp_attachments
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$pagination->generate_template_pagination(
|
||||||
|
$this->u_action,
|
||||||
|
'pagination',
|
||||||
|
'start',
|
||||||
|
$num_files,
|
||||||
|
$attachments_per_page,
|
||||||
|
$start
|
||||||
|
);
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
'TOTAL_FILES' => $num_files,
|
||||||
|
'TOTAL_SIZE' => get_formatted_filesize($total_size),
|
||||||
|
));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'manage':
|
case 'manage':
|
||||||
|
|
Loading…
Add table
Reference in a new issue