1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 07:07:51 +02:00

added attachments to user acp

fixed typo in stylesheet.css
added a.th class to admin css


git-svn-id: file:///svn/phpbb/trunk@4833 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2004-02-15 09:03:20 +00:00
parent 7dc62cc5ed
commit d8609ba1c6
5 changed files with 149 additions and 21 deletions

View File

@ -849,7 +849,7 @@ if ($submit || $preview || $deleteall || $deletemark)
WHERE user_id = $user_id";
$db->sql_query($sql);
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$mode\">", '</a>');
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"admin_users.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;u=$user_id\">", '</a>');
trigger_error($message);
}
@ -860,6 +860,40 @@ if ($submit || $preview || $deleteall || $deletemark)
case 'permissions':
break;
case 'attach':
$delete_ids = isset($_REQUEST['attachment']) ? array_keys(array_map('intval', $_REQUEST['attachment'])) : array();
if ($deletemark && sizeof($delete_ids))
{
if (!$cancel && !$confirm)
{
adm_page_confirm($user->lang['CONFIRM'], $user->lang['CONFIRM_OPERATION']);
}
else if (!$cancel)
{
$log_attachments = array();
$sql = 'SELECT real_filename
FROM ' . ATTACHMENTS_TABLE . '
WHERE attach_id IN (' . implode(', ', $delete_ids) . ')';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$log_attachments[] = $row['real_filename'];
}
$db->sql_freeresult($result);
delete_attachments('attach', $delete_ids);
add_log('admin', ((sizeof($delete_ids) == 1) ? 'ATTACHMENT_DELETED' : 'ATTACHMENTS_DELETED'), implode(', ', $log_attachments));
$message = ((sizeof($delete_ids) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']) . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"admin_users.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;u=$user_id\">", '</a>');
trigger_error($message);
}
}
break;
}
}
@ -872,7 +906,7 @@ if ($username || $user_id)
{
// Generate overall "header" for user admin
$form_options = '';
$forms_ary = array('overview' => 'OVERVIEW', 'feedback' => 'FEEDBACK', 'profile' => 'PROFILE', 'prefs' => 'PREFS', 'avatar' => 'AVATAR', 'sig' => 'SIG', 'groups' => 'GROUP', 'perm' => 'PERM');
$forms_ary = array('overview' => 'OVERVIEW', 'feedback' => 'FEEDBACK', 'profile' => 'PROFILE', 'prefs' => 'PREFS', 'avatar' => 'AVATAR', 'sig' => 'SIG', 'groups' => 'GROUP', 'perm' => 'PERM', 'attach' => 'ATTACH');
foreach ($forms_ary as $value => $lang)
{
@ -882,6 +916,9 @@ if ($username || $user_id)
$pagination = '';
$colspan = ($action == 'attach') ? '6' : '2';
$show_bottom = ($action == 'attach') ? false : true;
?>
<script language="javascript" type="text/javascript">
@ -925,7 +962,7 @@ e_help = "<?php echo $user->lang['BBCODE_E_HELP']; ?>";
<tr>
<td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0">
<tr>
<th colspan="2"><?php echo $user->lang['USER_ADMIN_' . strtoupper($action)]; ?></th>
<th colspan="<?php echo $colspan; ?>"><?php echo $user->lang['USER_ADMIN_' . strtoupper($action)]; ?></th>
</tr>
<?php
@ -934,7 +971,7 @@ e_help = "<?php echo $user->lang['BBCODE_E_HELP']; ?>";
?>
<tr>
<td class="row3" colspan="2" align="center"><span class="error"><?php echo implode('<br />', $error); ?></span></td>
<td class="row3" colspan="<?php echo $colspan; ?>" align="center"><span class="error"><?php echo implode('<br />', $error); ?></span></td>
</tr>
<?php
@ -1678,16 +1715,113 @@ function marklist(match, status)
case 'perm':
break;
case 'attach':
$uri = "admin_users.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;u=$user_id";
$sort_key = request_var('sk', 'a');
$sort_dir = request_var('sd', 'a');
$sort_key_text = array('a' => $user->lang['SORT_FILENAME'], 'b' => $user->lang['SORT_COMMENT'], 'c' => $user->lang['SORT_EXTENSION'], 'd' => $user->lang['SORT_SIZE'], 'e' => $user->lang['SORT_DOWNLOADS'], 'f' => $user->lang['SORT_POST_TIME'], 'g' => $user->lang['SORT_TOPIC_TITLE']);
$sort_key_sql = array('a' => 'a.real_filename', 'b' => 'a.comment', 'c' => 'a.extension', 'd' => 'a.filesize', 'e' => 'a.download_count', 'f' => 'a.filetime', 'g' => 't.topic_title');
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
$s_sort_key = '';
foreach ($sort_key_text as $key => $value)
{
$selected = ($sort_key == $key) ? ' selected="selected"' : '';
$s_sort_key .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
$s_sort_dir = '';
foreach ($sort_dir_text as $key => $value)
{
$selected = ($sort_dir == $key) ? ' selected="selected"' : '';
$s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
$order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
$sql = 'SELECT COUNT(*) as num_attachments
FROM ' . ATTACHMENTS_TABLE . "
WHERE poster_id = $user_id";
$result = $db->sql_query_limit($sql, 1);
$num_attachments = $db->sql_fetchfield('num_attachments', 0, $result);
$db->sql_freeresult($result);
$sql = 'SELECT a.*, t.topic_title
FROM ' . ATTACHMENTS_TABLE . ' a, ' . TOPICS_TABLE . " t
WHERE a.topic_id = t.topic_id
AND a.poster_id = $user_id
ORDER BY $order_by";
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
$row_count = 0;
if ($row = $db->sql_fetchrow($result))
{
$class = 'row2';
?>
<tr>
<th nowrap="nowrap">#</th>
<th nowrap="nowrap" width="15%"><a class="th" href="<?php echo $uri . '&amp;sk=a&amp;sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'); ?>"><?php echo $user->lang['FILENAME']; ?></a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="<?php echo $uri . '&amp;sk=f&amp;sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'); ?>"><?php echo $user->lang['POST_TIME']; ?></a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="<?php echo $uri . '&amp;sk=d&amp;sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'); ?>"><?php echo $user->lang['FILESIZE']; ?></a></th>
<th nowrap="nowrap" width="5%"><a class="th" href="<?php echo $uri . '&amp;sk=e&amp;sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'); ?>"><?php echo $user->lang['DOWNLOADS']; ?></a></th>
<th width="2%" nowrap="nowrap"><?php echo $user->lang['DELETE']; ?></th>
</tr>
<?php
do
{
$view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . '#' . $row['post_id'];
$class = ($class == 'row1') ? 'row2' : 'row1';
?>
<tr class="<?php echo $class; ?>">
<td class="gen" style="padding: 4px;" align="center" width="2%">&nbsp;<?php echo $row_count++ + ($start + 1); ?>&nbsp;</td>
<td style="padding: 4px;"><a class="gen" href="<?php echo $phpbb_root_path . 'download.' . $phpEx . $SID . '&amp;id=' . $row['attach_id']; ?>" target="file"><?php echo $row['real_filename']; ?></a><br /><span class="gensmall"><?php echo $user->lang['TOPIC']; ?>: <a href="<?php echo $view_topic; ?>" target="viewtopic"><?php echo $row['topic_title']; ?></a></span></td>
<td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap">&nbsp;<?php echo $user->format_date($row['filetime'], $user->lang['DATE_FORMAT']); ?>&nbsp;</td>
<td class="gen" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><?php echo ($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']); ?></td>
<td class="gen" style="padding: 4px;" align="center"><?php echo $row['download_count']; ?></td>
<td style="padding: 4px;" align="center" valign="middle"><input type="checkbox" name="attachment[<?php echo $row['attach_id']; ?>]" value="1" /></td>
</tr>
<?php
}
while ($row = $db->sql_fetchrow($result));
}
$db->sql_freeresult($result);
$pagination = generate_pagination($uri . "&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['posts_per_page'], $start)
?>
<tr>
<td class="cat" colspan="<?php echo $colspan; ?>"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="100%" align="center"><span class="gensmall"><?php echo $user->lang['SORT_BY']; ?>: </span><select name="sk"><?php echo $s_sort_key; ?></select> <select name="sd"><?php echo $s_sort_dir; ?></select>&nbsp;<input class="btnlite" type="submit" name="sort" value="<?php echo $user->lang['SORT']; ?>" /></td>
<td align="right"><input class="btnlite" type="submit" name="delmarked" value="<?php echo $user->lang['DELETE_MARKED']; ?>" />&nbsp;</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<?php
break;
}
if ($show_bottom)
{
?>
<tr>
<td class="cat" colspan="2" align="center"><?php echo ($action == 'sig') ? '<input class="btnlite" type="submit" name="preview" value="' . $user->lang['PREVIEW'] . '" />&nbsp;&nbsp;' : ''; ?><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
</tr>
</table></td>
</tr>
<?php
}
if ($pagination)
{

View File

@ -237,7 +237,7 @@ function adm_page_confirm($title, $message)
<br /><br />
<form name="confirm" method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>">
<form name="confirm" method="post" action="<?php echo $_SERVER['SCRIPT_NAME'] . $SID; ?>">
<table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th><?php echo $title; ?></th>

View File

@ -60,23 +60,16 @@ h2 {
/*
Anchors
*/
a:link, a:active, a:visited {
color: #006699;
text-decoration: none;
}
a:hover {
color: #DD6900;
text-decoration: underline;
}
a:link, a:active, a:visited { color: #006699; text-decoration: none; }
a:hover { color: #DD6900; text-decoration: underline; }
a.nav {
color: #006699;
text-decoration: none;
}
a.nav:hover {
text-decoration: underline;
}
a.nav { color: #006699; text-decoration: none; }
a.nav:hover { text-decoration: underline; }
a.th:link { color: #FFA34F; text-decoration: none; }
a.th:active { color: #FFA34F; text-decoration: none; }
a.th:visited { color: #FFA34F; text-decoration: none; }
a.th:hover { color: #FFA34F; text-decoration: underline; }
/*
Non-tag specific

View File

@ -1037,6 +1037,7 @@ $lang += array(
'USER_ADMIN_SIG' => 'Signature',
'USER_ADMIN_GROUP' => 'Groups',
'USER_ADMIN_PERM' => 'Permissions',
'USER_ADMIN_ATTACH' => 'Attachments',
'FOUNDER' => 'Founder',
'FOUNDER_EXPLAIN' => 'Founders can never be banned, deleted or altered by non-founder members',

View File

@ -105,7 +105,7 @@ a:active { color: #005784; text-decoration: none; }
a:visited { color: #005784; text-decoration: none; }
a:hover { color: #D46400; text-decoration: underline; }
a.topictitle:visited { color: #5493B4; text-decoration: none; }
a.th:link, { color: #FFA34F; text-decoration: none; }
a.th:link { color: #FFA34F; text-decoration: none; }
a.th:active { color: #FFA34F; text-decoration: none; }
a.th:visited { color: #FFA34F; text-decoration: none; }
a.th:hover { color: #FFA34F; text-decoration: underline; }