1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-20 16:15:00 +01:00

Some minor alterations to neaten it up a little ... hopefully Acyd won't be too upset

git-svn-id: file:///svn/phpbb/trunk@4656 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2003-11-08 18:12:46 +00:00
parent dd5120f95e
commit 4a05ef300b
2 changed files with 40 additions and 42 deletions

View File

@ -100,25 +100,23 @@ class ucp_attachments extends module
$i = 0;
while ($row = $db->sql_fetchrow($result))
{
$topic_title = (strlen($row['topic_title']) > 32) ? substr($row['topic_title'], 0, 30) . '...' : $row['topic_title'];
$view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . '#' . $row['post_id'];
$topic_title = '<a href="' . $view_topic . '" class="gen" target="_blank">' . $topic_title . '</a>';
$template->assign_block_vars('attachrow', array(
'ROW_NUMBER' => $i + ($start + 1),
'S_ROW_COUNT' => $i,
'ATTACH_ID' => $row['attach_id'],
'FILENAME' => $row['real_filename'],
'COMMENT' => str_replace("\n", '<br />', $row['comment']),
'EXTENSION' => $row['extension'],
'ROW_NUMBER' => $i + ($start + 1),
'ATTACH_ID' => $row['attach_id'],
'FILENAME' => $row['real_filename'],
'COMMENT' => str_replace("\n", '<br />', $row['comment']),
'EXTENSION' => $row['extension'],
'SIZE' => ($row['filesize'] >= 1048576) ? (round($row['filesize'] / 1048576 * 100) / 100) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? (round($row['filesize'] / 1024 * 100) / 100) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']),
'DOWNLOAD_COUNT' => $row['download_count'],
'POST_TIME' => $user->format_date($row['filetime'], $user->lang['DATE_FORMAT']),
'TOPIC_TITLE' => $topic_title,
'TOPIC_TITLE' => $row['topic_title'],
'U_VIEW_ATTACHMENT' => $phpbb_root_path . 'download.' . $phpEx . $SID . '&amp;id=' . $row['attach_id'])
'S_ROW_COUNT' => $i,
'U_VIEW_ATTACHMENT' => $phpbb_root_path . 'download.' . $phpEx . $SID . '&amp;id=' . $row['attach_id'],
'U_VIEW_TOPIC' => $view_topic)
);
$i++;
}

View File

@ -4,28 +4,26 @@
<!-- IF S_CONFIRM_DELETE -->
<table class="tablebg" width="80%" cellspacing="1" cellpadding="4" border="0" align="right">
<tr>
<th height="28" valign="middle">{MESSAGE_TITLE}</th>
</tr>
<tr>
<td class="row1" align="center"><span class="gen"><br />{MESSAGE_TEXT}<br /><br />{S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{L_YES}" class="btnmain" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" class="btnlite" /></span></td>
</tr>
<tr>
<th height="28" valign="middle">{MESSAGE_TITLE}</th>
</tr>
<tr>
<td class="row1" align="center"><span class="gen"><br />{MESSAGE_TEXT}<br /><br />{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="confirm" value="{L_YES}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="cancel" value="{L_NO}" /></span></td>
</tr>
</table>
<!-- ELSEIF attachrow -->
<table class="tablebg" width="80%" cellspacing="1" cellpadding="4" border="0" align="right">
<tr>
<th height="28" nowrap="nowrap">#</th>
<th nowrap="nowrap" width="15%"><a class="th" href="{U_SORT_FILENAME}">{L_FILENAME}</a></th>
<th nowrap="nowrap" width="25%"><a class="th" href="{U_SORT_FILE_COMMENT}">{L_FILE_COMMENT}</a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="{U_SORT_EXTENSION}">{L_EXTENSION}</a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="{U_SORT_FILESIZE}">{L_FILESIZE}</a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="{U_SORT_DOWNLOADS}">{L_DOWNLOADS}</a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="{U_SORT_POST_TIME}">{L_POST_TIME}</a></th>
<th nowrap="nowrap" width="15%"><a class="th" href="{U_SORT_TOPIC_TITLE}">{L_TOPIC_TITLE}</a></th>
<th width="2%" nowrap="nowrap">{L_DELETE}</th>
</tr>
<tr>
<th nowrap="nowrap">#</th>
<th nowrap="nowrap" width="15%"><a class="th" href="{U_SORT_FILENAME}">{L_FILENAME}</a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="{U_SORT_POST_TIME}">{L_POST_TIME}</a></th>
<!-- th nowrap="nowrap" width="25%"><a class="th" href="{U_SORT_FILE_COMMENT}">{L_FILE_COMMENT}</a></th -->
<th nowrap="nowrap" width="5%"><a class="th" href="{U_SORT_FILESIZE}">{L_FILESIZE}</a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="{U_SORT_DOWNLOADS}">{L_DOWNLOADS}</a></th>
<th width="2%" nowrap="nowrap">{L_DELETE}</th>
</tr>
<!-- BEGIN attachrow -->
@ -36,31 +34,33 @@
<!-- ENDIF -->
<td class="gen" align="center" width="2%">&nbsp;{attachrow.ROW_NUMBER}&nbsp;</td>
<td class="gen" align="center"><a href="{attachrow.U_VIEW_ATTACHMENT}" target="file">{attachrow.FILENAME}</a></td>
<td class="gen" align="center">{attachrow.COMMENT}</td>
<td class="gen" align="center">{attachrow.EXTENSION}</td>
<td><a class="gen" href="{attachrow.U_VIEW_ATTACHMENT}" target="file">{attachrow.FILENAME}</a><br /><span class="gensmall">{L_TOPIC}: <a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></span></td>
<td class="gensmall" align="center" valign="middle" nowrap="nowrap">&nbsp;{attachrow.POST_TIME}&nbsp;</td>
<!-- td class="gen" align="center">{attachrow.COMMENT}</td -->
<td class="gen" align="center" valign="middle" nowrap="nowrap">{attachrow.SIZE}</td>
<td class="gen" align="center">{attachrow.DOWNLOAD_COUNT}</td>
<td class="gensmall" align="center" valign="middle" nowrap="nowrap">&nbsp;{attachrow.POST_TIME}&nbsp;</td>
<td class="gen" align="center">{attachrow.TOPIC_TITLE}</td>
<td align="center" valign="middle"><input type="checkbox" name="attachment[{attachrow.ATTACH_ID}]" value="1" /></td>
</tr>
<!-- END attachrow -->
<tr>
<td class="cat" colspan="7" height="28"><div align="center"><span class="gen">{L_SORT_BY}: </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select>&nbsp;<input type="submit" name="sort" value="{L_SORT}" class="btnlite" /></div></td>
<td class="cat" colspan="2" height="28" align="right"><input type="submit" name="delete" value="{L_DELETE_MARKED}" class="btnlite" /></td>
</tr>
<tr>
<td class="cat" colspan="6"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="100%" align="center"><span class="gensmall">{L_SORT_BY}: </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select>&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></td>
<td align="right"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" /></td>
</tr>
</table></td>
</tr>
</table>
<!-- ELSE -->
<table class="tablebg" width="80%" cellspacing="1" cellpadding="4" border="0" align="right">
<tr>
<th>{L_UCP_NO_ATTACHMENTS}</th>
</tr>
<tr>
<th>{L_UCP_NO_ATTACHMENTS}</th>
</tr>
</table>
<!-- ENDIF -->
<!-- INCLUDE ucp_footer.html -->
<!-- INCLUDE ucp_footer.html -->