mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 07:35:29 +02:00
- custom profile fields
- prune users - prune forums git-svn-id: file:///svn/phpbb/trunk@5325 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
85fdeda51c
commit
b41525229b
File diff suppressed because it is too large
Load Diff
@ -1,254 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acp
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_prune'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['FORUM']['PRUNE'] = basename(__FILE__) . $SID . '&mode=forums';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have permission?
|
||||
if (!$auth->acl_get('a_prune'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Get the forum ID for pruning
|
||||
$forum_id = (isset($_REQUEST['f'])) ? array_map('intval', $_REQUEST['f']) : array();
|
||||
|
||||
// Check for submit to be equal to Prune. If so then proceed with the pruning.
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
$prune_posted = (isset($_POST['prune_days'])) ? intval($_POST['prune_days']) : 0;
|
||||
$prune_viewed = (isset($_POST['prune_vieweddays'])) ? intval($_POST['prune_vieweddays']) : 0;
|
||||
$prune_all = !$prune_posted && !$prune_viewed;
|
||||
|
||||
$prune_flags = 0;
|
||||
$prune_flags += (!empty($_POST['prune_old_polls'])) ? 2 : 0;
|
||||
$prune_flags += (!empty($_POST['prune_announce'])) ? 4 : 0;
|
||||
$prune_flags += (!empty($_POST['prune_sticky'])) ? 8 : 0;
|
||||
|
||||
// Convert days to seconds for timestamp functions...
|
||||
$prunedate_posted = time() - ($prune_posted * 86400);
|
||||
$prunedate_viewed = time() - ($prune_viewed * 86400);
|
||||
|
||||
adm_page_header($user->lang['PRUNE']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['PRUNE']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['PRUNE_SUCCESS']; ?></p>
|
||||
|
||||
<table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['FORUM']; ?></th>
|
||||
<th><?php echo $user->lang['TOPICS_PRUNED']; ?></th>
|
||||
<th><?php echo $user->lang['POSTS_PRUNED']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$sql_forum = (sizeof($forum_id)) ? ' AND forum_id IN (' . implode(', ', $forum_id) . ')' : '';
|
||||
|
||||
// Get a list of forum's or the data for the forum that we are pruning.
|
||||
$sql = 'SELECT forum_id, forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST . "
|
||||
$sql_forum
|
||||
ORDER BY left_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$prune_ids = array();
|
||||
$p_result['topics'] = 0;
|
||||
$p_result['posts'] = 0;
|
||||
$log_data = '';
|
||||
do
|
||||
{
|
||||
if ($auth->acl_get('f_list', $row['forum_id']))
|
||||
{
|
||||
if ($prune_all)
|
||||
{
|
||||
$p_result = prune($row['forum_id'], 'posted', time(), $prune_flags, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($prune_posted)
|
||||
{
|
||||
$return = prune($row['forum_id'], 'posted', $prunedate_posted, $prune_flags, false);
|
||||
$p_result['topics'] += $return['topics'];
|
||||
$p_result['posts'] += $return['posts'];
|
||||
}
|
||||
if ($prune_viewed)
|
||||
{
|
||||
$return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false);
|
||||
$p_result['topics'] += $return['topics'];
|
||||
$p_result['posts'] += $return['posts'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$prune_ids[] = $row['forum_id'];
|
||||
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['forum_name']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $p_result['topics']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $p_result['posts']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name'];
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
// Sync all pruned forums at once
|
||||
sync('forum', 'forum_id', $prune_ids, TRUE);
|
||||
|
||||
add_log('admin', 'LOG_PRUNE', $log_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" align="center"><?php echo $user->lang['NO_PRUNE']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
<?php
|
||||
|
||||
adm_page_footer();
|
||||
|
||||
}
|
||||
|
||||
adm_page_header($user->lang['PRUNE']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['PRUNE']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['FORUM_PRUNE_EXPLAIN']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
// If they haven't selected a forum for pruning yet then
|
||||
// display a select box to use for pruning.
|
||||
if (!$forum_id)
|
||||
{
|
||||
|
||||
?>
|
||||
|
||||
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th align="center"><?php echo $user->lang['SELECT_FORUM']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><select name="f[]" multiple="true" size="5"><?php echo make_forum_select(false, false, false); ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" align="center"><input class="btnmain" type="submit" value="<?php echo $user->lang['LOOK_UP_FORUM']; ?>" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="btnlite" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT forum_id, forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_id IN (' . implode(', ', $forum_id) . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if (!($row = $db->sql_fetchrow($result)))
|
||||
{
|
||||
trigger_error($user->lang['NO_FORUM']);
|
||||
}
|
||||
|
||||
$forum_list = $s_hidden_fields = '';
|
||||
do
|
||||
{
|
||||
$forum_list .= (($forum_list != '') ? ', ' : '') . '<b>' . $row['forum_name'] . '</b>';
|
||||
$s_hidden_fields .= '<input type="hidden" name="f[]" value="' . $row['forum_id'] . '" />';
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$l_selected_forums = (sizeof($forum_id) == 1) ? 'SELECTED_FORUM' : 'SELECTED_FORUMS';
|
||||
|
||||
?>
|
||||
|
||||
<h2><?php echo $user->lang['FORUM']; ?></h2>
|
||||
|
||||
<p><?php echo $user->lang[$l_selected_forums] . ': ' . $forum_list; ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['FORUM_PRUNE']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_NOT_POSTED']; ?></td>
|
||||
<td class="row2"><input type="text" name="prune_days" size="4" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_NOT_VIEWED']; ?></td>
|
||||
<td class="row2"><input type="text" name="prune_vieweddays" size="4" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_OLD_POLLS'] ?>: <br /><span class="gensmall"><?php echo $user->lang['PRUNE_OLD_POLLS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="prune_old_polls" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_old_polls" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_ANNOUNCEMENTS'] ?>: </td>
|
||||
<td class="row2"><input type="radio" name="prune_announce" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_announce" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['PRUNE_STICKY'] ?>: </td>
|
||||
<td class="row2"><input type="radio" name="prune_sticky" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_sticky" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="btnmain"></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
adm_page_footer();
|
||||
|
||||
?>
|
@ -1,254 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acp
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_userdel'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['USER']['PRUNE_USERS'] = basename(__FILE__) . $SID;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have forum admin permissions?
|
||||
if (!$auth->acl_get('a_userdel'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Set mode
|
||||
$mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : '';
|
||||
|
||||
// Do prune
|
||||
if (isset($_POST['prune']))
|
||||
{
|
||||
if (empty($_POST['confirm']))
|
||||
{
|
||||
$values = array('prune', 'deactivate', 'delete', 'users', 'username', 'email', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'deleteposts');
|
||||
|
||||
$l_message = '<form method="post" action="admin_prune_users.' . $phpEx . $SID . '">' . $user->lang['Confirm_prune_users'] . '<br /><br /><input class="btnlite" type="submit" name="confirm" value="' . $user->lang['Yes'] . '" /> <input class="btnlite" type="submit" name="cancel" value="' . $user->lang['No'] . '" />';
|
||||
|
||||
foreach ($values as $field)
|
||||
{
|
||||
$l_message .= (!empty($_POST[$field])) ? '<input type="hidden" name="' . $field . '" value="' . urlencode($_POST[$field]) . '" />' : '';
|
||||
}
|
||||
|
||||
$l_message .= '</form>';
|
||||
|
||||
adm_page_header($user->lang['Prune_users']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['PRUNE_USERS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['PRUNE_USERS_EXPLAIN']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
page_message($user->lang['CONFIRM'], $l_message, false);
|
||||
adm_page_footer();
|
||||
|
||||
}
|
||||
else if (isset($_POST['confirm']))
|
||||
{
|
||||
if (!empty($_POST['users']))
|
||||
{
|
||||
$users = explode("\n", urldecode($_POST['users']));
|
||||
|
||||
$where_sql = '';
|
||||
foreach ($users as $username)
|
||||
{
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . '\'' . trim($username) . '\'';
|
||||
}
|
||||
$where_sql = " AND username IN ($where_sql)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = (!empty($_POST['username'])) ? urldecode($_POST['username']) : '';
|
||||
$email = (!empty($_POST['email'])) ? urldecode($_POST['email']) : '';
|
||||
|
||||
$joined_select = (!empty($_POST['joined_select'])) ? $_POST['joined_select'] : 'lt';
|
||||
$active_select = (!empty($_POST['active_select'])) ? $_POST['active_select'] :'lt';
|
||||
$count_select = (!empty($_POST['count_select'])) ? $_POST['count_select'] : 'eq';
|
||||
$joined = (!empty($_POST['joined'])) ? explode('-', $_POST['joined']) : array();
|
||||
$active = (!empty($_POST['active'])) ? explode('-', $_POST['active']) :array();
|
||||
$count = (!empty($_POST['count'])) ? intval($_POST['count']) : '';
|
||||
|
||||
$key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
|
||||
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
|
||||
|
||||
$where_sql = '';
|
||||
$where_sql .= ($username) ? " AND username LIKE '" . str_replace('*', '%', $username) ."'" : '';
|
||||
$where_sql .= ($email) ? " AND user_email LIKE '" . str_replace('*', '%', $email) ."' " : '';
|
||||
$where_sql .= ($joined) ? " AND user_regdate " . $key_match[$joined_select] . " " . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
|
||||
$where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . " $count " : '';
|
||||
$where_sql .= ($active) ? " AND user_lastvisit " . $key_match[$active_select] . " " . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
|
||||
}
|
||||
|
||||
$sql = 'SELECT username, user_id FROM ' . USERS_TABLE . '
|
||||
WHERE user_id <> ' . ANONYMOUS . "
|
||||
$where_sql";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$where_sql = '';
|
||||
$user_ids = array();
|
||||
$usernames = array();
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . $row['user_id'];
|
||||
$user_ids[] = $row['user_id'];
|
||||
$usernames[] = $row['username'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$where_sql = " AND user_id IN ($where_sql)";
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($where_sql != '')
|
||||
{
|
||||
$sql = '';
|
||||
if (!empty($_POST['delete']))
|
||||
{
|
||||
if (!empty($_POST['deleteposts']))
|
||||
{
|
||||
// Call unified post deletion routine?
|
||||
|
||||
$l_log = 'LOG_PRUNE_USER_DEL_DEL';
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i = 0; $i < sizeof($user_ids); $i++)
|
||||
{
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET poster_id = ' . ANONYMOUS . ", post_username = '" . $usernames[$i] . "'
|
||||
WHERE user_id = " . $userids[$i];
|
||||
// $db->sql_query($sql);
|
||||
}
|
||||
|
||||
$l_log = 'LOG_PRUNE_USER_DEL_ANON';
|
||||
}
|
||||
|
||||
$sql = 'DELETE FROM ' . USERS_TABLE;
|
||||
}
|
||||
else if (!empty($_POST['deactivate']))
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||
SET user_active = 0";
|
||||
|
||||
$l_log = 'LOG_PRUNE_USER_DEAC';
|
||||
}
|
||||
|
||||
$sql .= ' WHERE user_id <> ' . ANONYMOUS . "
|
||||
$where_sql";
|
||||
// $db->sql_query($sql);
|
||||
|
||||
add_log('admin', $l_log, implode(', ', $usernames));
|
||||
|
||||
unset($user_ids);
|
||||
unset($usernames);
|
||||
}
|
||||
|
||||
trigger_error($user->lang['SUCCESS_USER_PRUNE']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Front end
|
||||
$find_count = array('lt' => $user->lang['LESS_THAN'], 'eq' => $user->lang['EQUAL_TO'], 'gt' => $user->lang['MORE_THAN']);
|
||||
$s_find_count = '';
|
||||
foreach ($find_count as $key => $value)
|
||||
{
|
||||
$selected = ($key == 'eq') ? ' selected="selected"' : '';
|
||||
$s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
|
||||
}
|
||||
|
||||
$find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']);
|
||||
$s_find_join_time = '';
|
||||
foreach ($find_time as $key => $value)
|
||||
{
|
||||
$s_find_join_time .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
$s_find_active_time = '';
|
||||
foreach ($find_time as $key => $value)
|
||||
{
|
||||
$s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
adm_page_header($user->lang['PRUNE_USERS']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['PRUNE_USERS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['PRUNE_USERS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" name="post" action="<?php echo "admin_prune_users.$phpEx$SID"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['PRUNE_USERS']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="40%"><b><?php echo $user->lang['USERNAME']; ?>: </b></td>
|
||||
<td class="row2"><input class="post" type="text" name="username" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['EMAIL']; ?>: </b></td>
|
||||
<td class="row2"><input class="post" type="text" name="email" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['JOINED']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['Joined_explain']; ?></span></td>
|
||||
<td class="row2"><select name="joined_select"><?php echo $s_find_join_time; ?></select> <input class="post" type="text" name="joined" maxlength="10" size="10" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['LAST_ACTIVE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['Last_active_explain']; ?></span></td>
|
||||
<td class="row2"><select name="active_select"><?php echo $s_find_active_time; ?></select> <input class="post" type="text" name="active" maxlength="10" size="10" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['POSTS']; ?>: </b></td>
|
||||
<td class="row2"><select name="count_select"><?php echo $s_find_count; ?></select> <input class="post" type="text" name="count" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['PRUNE_USERS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['SELECT_USERS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><textarea name="users" cols="40" rows="5"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['DELETE_USER_POSTS']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['DELETE_USER_POSTS_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="deleteposts" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="deleteposts" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><b><?php echo $user->lang['DEACTIVATE_DELETE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['DEACTIVATE_DELETE_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="action" value="delete" /> <?php echo $user->lang['DELETE_USERS']; ?> <input type="radio" name="action" value="deactivate" checked="checked" /> <?php echo $user->lang['DEACTIVATE']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="btnlite" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input type="submit" name="usersubmit" value="<?php echo $user->lang['FIND_USERNAME']; ?>" class="btnlite" onClick="window.open('<?php echo "../search.$phpEx$SID&mode=searchuser&field=users"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /><input type="hidden" name="prune" value="1" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
adm_page_footer();
|
||||
|
||||
?>
|
1268
phpBB/includes/acp/acp_profile.php
Normal file
1268
phpBB/includes/acp/acp_profile.php
Normal file
File diff suppressed because it is too large
Load Diff
409
phpBB/includes/acp/acp_prune.php
Normal file
409
phpBB/includes/acp/acp_prune.php
Normal file
@ -0,0 +1,409 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package acp
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package acp
|
||||
*/
|
||||
class acp_prune
|
||||
{
|
||||
var $u_action = '';
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $user, $phpEx, $SID, $phpbb_admin_path;
|
||||
|
||||
$user->add_lang('acp/prune');
|
||||
|
||||
$this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'forums':
|
||||
$this->tpl_name = 'acp_prune_forums';
|
||||
$this->page_header = 'ACP_PRUNE_FORUMS';
|
||||
$this->prune_forums($id, $mode);
|
||||
break;
|
||||
|
||||
case 'users':
|
||||
$this->tpl_name = 'acp_prune_users';
|
||||
$this->page_header = 'ACP_PRUNE_USERS';
|
||||
$this->prune_users($id, $mode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prune forums
|
||||
*/
|
||||
function prune_forums($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
|
||||
$forum_id = request_var('f', array(0));
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$prune_posted = request_var('prune_days', 0);
|
||||
$prune_viewed = request_var('prune_vieweddays', 0);
|
||||
$prune_all = !$prune_posted && !$prune_viewed;
|
||||
|
||||
$prune_flags = 0;
|
||||
$prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0;
|
||||
$prune_flags += (request_var('prune_announce', 0)) ? 4 : 0;
|
||||
$prune_flags += (request_var('prune_sticky', 0)) ? 8 : 0;
|
||||
|
||||
// Convert days to seconds for timestamp functions...
|
||||
$prunedate_posted = time() - ($prune_posted * 86400);
|
||||
$prunedate_viewed = time() - ($prune_viewed * 86400);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_PRUNED' => true)
|
||||
);
|
||||
|
||||
$sql_forum = (sizeof($forum_id)) ? ' AND forum_id IN (' . implode(', ', $forum_id) . ')' : '';
|
||||
|
||||
// Get a list of forum's or the data for the forum that we are pruning.
|
||||
$sql = 'SELECT forum_id, forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST . "
|
||||
$sql_forum
|
||||
ORDER BY left_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$prune_ids = array();
|
||||
$p_result['topics'] = 0;
|
||||
$p_result['posts'] = 0;
|
||||
$log_data = '';
|
||||
|
||||
do
|
||||
{
|
||||
if (!$auth->acl_get('f_list', $row['forum_id']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($prune_all)
|
||||
{
|
||||
$p_result = prune($row['forum_id'], 'posted', time(), $prune_flags, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($prune_posted)
|
||||
{
|
||||
$return = prune($row['forum_id'], 'posted', $prunedate_posted, $prune_flags, false);
|
||||
$p_result['topics'] += $return['topics'];
|
||||
$p_result['posts'] += $return['posts'];
|
||||
}
|
||||
|
||||
if ($prune_viewed)
|
||||
{
|
||||
$return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false);
|
||||
$p_result['topics'] += $return['topics'];
|
||||
$p_result['posts'] += $return['posts'];
|
||||
}
|
||||
}
|
||||
|
||||
$prune_ids[] = $row['forum_id'];
|
||||
|
||||
$template->assign_block_vars('pruned', array(
|
||||
'FORUM_NAME' => $row['forum_name'],
|
||||
'NUM_TOPICS' => $p_result['topics'],
|
||||
'NUM_POSTS' => $p_result['posts'])
|
||||
);
|
||||
|
||||
$log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
// Sync all pruned forums at once
|
||||
sync('forum', 'forum_id', $prune_ids, true);
|
||||
add_log('admin', 'LOG_PRUNE', $log_data);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// If they haven't selected a forum for pruning yet then
|
||||
// display a select box to use for pruning.
|
||||
if (!sizeof($forum_id))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'U_ACTION' => $this->u_action,
|
||||
'S_SELECT_FORUM' => true,
|
||||
'S_FORUM_OPTIONS' => make_forum_select(false, false, false))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT forum_id, forum_name
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_id IN (' . implode(', ', $forum_id) . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if (!($row = $db->sql_fetchrow($result)))
|
||||
{
|
||||
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
$forum_list = $s_hidden_fields = '';
|
||||
do
|
||||
{
|
||||
$forum_list .= (($forum_list != '') ? ', ' : '') . '<b>' . $row['forum_name'] . '</b>';
|
||||
$s_hidden_fields .= '<input type="hidden" name="f[]" value="' . $row['forum_id'] . '" />';
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$l_selected_forums = (sizeof($forum_id) == 1) ? 'SELECTED_FORUM' : 'SELECTED_FORUMS';
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_SELECTED_FORUMS' => $user->lang[$l_selected_forums],
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_BACK' => $this->u_action,
|
||||
'FORUM_LIST' => $forum_list,
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Prune users
|
||||
*/
|
||||
function prune_users($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $cache;
|
||||
global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
|
||||
|
||||
$user->add_lang('memberlist');
|
||||
|
||||
$prune = (isset($_POST['prune'])) ? true : false;
|
||||
|
||||
if ($prune)
|
||||
{
|
||||
if (confirm_box(true))
|
||||
{
|
||||
$users = request_var('users', '');
|
||||
$action = request_var('action', 'deactivate');
|
||||
$deleteposts = request_var('deleteposts', 0);
|
||||
|
||||
if ($users)
|
||||
{
|
||||
$users = explode("\n", $users);
|
||||
|
||||
$where_sql = '';
|
||||
|
||||
foreach ($users as $username)
|
||||
{
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . "'" . $db->sql_escape($username) . "'";
|
||||
}
|
||||
$where_sql = " AND username IN ($where_sql)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = request_var('username', '');
|
||||
$email = request_var('email', '');
|
||||
|
||||
$joined_select = request_var('joined_select', 'lt');
|
||||
$active_select = request_var('active_select', 'lt');
|
||||
$count_select = request_var('count_select', 'eq');
|
||||
$joined = request_var('joined', '');
|
||||
$active = request_var('active', '');
|
||||
|
||||
$active = ($active) ? explode('-', $active) : array();
|
||||
$joined = ($joined) ? explode('-', $joined) : array();
|
||||
|
||||
$count = request_var('count', 0);
|
||||
|
||||
$key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
|
||||
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
|
||||
|
||||
$where_sql = '';
|
||||
$where_sql .= ($username) ? " AND username LIKE '" . $db->sql_escape(str_replace('*', '%', $username)) . "'" : '';
|
||||
$where_sql .= ($email) ? " AND user_email LIKE '" . $db->sql_escape(str_replace('*', '%', $email)) . "' " : '';
|
||||
$where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : '';
|
||||
$where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . " $count " : '';
|
||||
$where_sql .= (sizeof($active)) ? " AND user_lastvisit " . $key_match[$active_select] . " " . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]) : '';
|
||||
}
|
||||
|
||||
// Get bot ids
|
||||
$sql = 'SELECT user_id
|
||||
FROM ' . BOTS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$bot_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$bot_ids[] = $row['user_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT username, user_id FROM ' . USERS_TABLE . '
|
||||
WHERE user_id <> ' . ANONYMOUS . "
|
||||
$where_sql";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$where_sql = '';
|
||||
$user_ids = $usernames = array();
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
if (!in_array($row['user_id'], $bot_ids))
|
||||
{
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . $row['user_id'];
|
||||
$user_ids[] = $row['user_id'];
|
||||
$usernames[] = $row['username'];
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
if ($where_sql)
|
||||
{
|
||||
$where_sql = " AND user_id IN ($where_sql)";
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($where_sql)
|
||||
{
|
||||
$sql = '';
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
if ($deleteposts)
|
||||
{
|
||||
delete_posts('poster_id', $user_ids, true);
|
||||
$l_log = 'LOG_PRUNE_USER_DEL_DEL';
|
||||
}
|
||||
else
|
||||
{
|
||||
for ($i = 0, $size = sizeof($user_ids); $i < $size; $i++)
|
||||
{
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($usernames[$i]) . "'
|
||||
WHERE user_id = " . $userids[$i];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$l_log = 'LOG_PRUNE_USER_DEL_ANON';
|
||||
}
|
||||
|
||||
$sql = 'DELETE FROM ' . USERS_TABLE;
|
||||
}
|
||||
else if ($action == 'deactivate')
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||
SET user_active = 0";
|
||||
|
||||
$l_log = 'LOG_PRUNE_USER_DEAC';
|
||||
}
|
||||
|
||||
$sql .= ' WHERE user_id <> ' . ANONYMOUS . "
|
||||
$where_sql";
|
||||
$db->sql_query($sql);
|
||||
|
||||
add_log('admin', $l_log, implode(', ', $usernames));
|
||||
}
|
||||
|
||||
trigger_error($user->lang['USER_' . strtoupper($action) . '_SUCCESS'] . adm_back_link($this->u_action));
|
||||
}
|
||||
else
|
||||
{
|
||||
confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
|
||||
'i' => $id,
|
||||
'mode' => $mode,
|
||||
'prune' => 1,
|
||||
|
||||
'users' => request_var('users', ''),
|
||||
'username' => request_var('username', ''),
|
||||
'email' => request_var('email', ''),
|
||||
'joined_select' => request_var('joined_select', ''),
|
||||
'joined' => request_var('joined', ''),
|
||||
'active_select' => request_var('active_select', ''),
|
||||
'active' => request_var('active', ''),
|
||||
'count_select' => request_var('count_select', ''),
|
||||
'count' => request_var('count', 0),
|
||||
'deleteposts' => request_var('deleteposts', 0),
|
||||
|
||||
'action' => request_var('action', ''),
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
$find_count = array('lt' => $user->lang['LESS_THAN'], 'eq' => $user->lang['EQUAL_TO'], 'gt' => $user->lang['MORE_THAN']);
|
||||
$s_find_count = '';
|
||||
|
||||
foreach ($find_count as $key => $value)
|
||||
{
|
||||
$selected = ($key == 'eq') ? ' selected="selected"' : '';
|
||||
$s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
|
||||
}
|
||||
|
||||
$find_time = array('lt' => $user->lang['BEFORE'], 'gt' => $user->lang['AFTER']);
|
||||
$s_find_join_time = '';
|
||||
foreach ($find_time as $key => $value)
|
||||
{
|
||||
$s_find_join_time .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
|
||||
$s_find_active_time = '';
|
||||
foreach ($find_time as $key => $value)
|
||||
{
|
||||
$s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_ACTION' => $this->u_action,
|
||||
'S_JOINED_OPTIONS' => $s_find_join_time,
|
||||
'S_ACTIVE_OPTIONS' => $s_find_active_time,
|
||||
'S_COUNT_OPTIONS' => $s_find_count,
|
||||
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_prune&field=users")
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @package module_install
|
||||
*/
|
||||
class acp_prune_info
|
||||
{
|
||||
function module()
|
||||
{
|
||||
return array(
|
||||
'filename' => 'acp_prune',
|
||||
'title' => 'ACP_PRUNING',
|
||||
'version' => '1.0.0',
|
||||
'modes' => array(
|
||||
'forums' => array('title' => 'ACP_PRUNE_FORUMS', 'auth' => 'acl_a_prune'),
|
||||
'users' => array('title' => 'ACP_PRUNE_USERS', 'auth' => 'acl_a_userdel'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function install()
|
||||
{
|
||||
}
|
||||
|
||||
function uninstall()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1050,6 +1050,14 @@ function meta_refresh($time, $url)
|
||||
|
||||
/**
|
||||
* Build Confirm box
|
||||
* @param boolean $check True for checking if confirmed (without any additional parameters) and false for displaying the confirm box
|
||||
* @param string $title Title/Message used for confirm box.
|
||||
* message text is _CONFIRM appended to title.
|
||||
* If title can not be found in user->lang a default one is displayed
|
||||
* If title_CONFIRM can not be found in user->lang the text given is used.
|
||||
* @param string $hidden Hidden variables
|
||||
* @param string $html_body Template used for confirm box
|
||||
* @param string $u_action Custom form action
|
||||
*/
|
||||
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
|
||||
{
|
||||
|
@ -1501,6 +1501,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
|
||||
{
|
||||
$sql_and .= ' AND topic_type <> ' . POST_ANNOUNCE;
|
||||
}
|
||||
|
||||
if (!($prune_flags & 8))
|
||||
{
|
||||
$sql_and .= ' AND topic_type <> ' . POST_STICKY;
|
||||
@ -1510,6 +1511,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
|
||||
{
|
||||
$sql_and .= " AND topic_last_post_time < $prune_date";
|
||||
}
|
||||
|
||||
if ($prune_mode == 'viewed')
|
||||
{
|
||||
$sql_and .= " AND topic_last_view_time < $prune_date";
|
||||
|
@ -145,7 +145,9 @@ class p_master
|
||||
|
||||
$right = $row['right_id'];
|
||||
|
||||
$url_func = $row['module_name'] . '_' . $row['module_mode'] . '_url';
|
||||
// We need to prefix the functions to not create a naming conflict
|
||||
$url_func = '_module_' . $row['module_name'] . '_' . $row['module_mode'] . '_url';
|
||||
$lang_func = '_module_' . $row['module_name'];
|
||||
|
||||
$this->module_ary[$i] = array(
|
||||
'depth' => $depth,
|
||||
@ -160,7 +162,7 @@ class p_master
|
||||
|
||||
'url_extra' => (function_exists($url_func)) ? $url_func() : '',
|
||||
|
||||
'lang' => (function_exists($row['module_name'])) ? $row['module_name']($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
|
||||
'lang' => ($row['module_name'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
|
||||
'langname' => $row['module_langname'],
|
||||
|
||||
'left' => $row['left_id'],
|
||||
|
@ -303,9 +303,9 @@ class custom_profile
|
||||
case FIELD_DATE:
|
||||
$field_validate = explode('-', $field_value);
|
||||
|
||||
$day = (int) $field_validate[0];
|
||||
$month = (int) $field_validate[1];
|
||||
$year = (int) $field_validate[2];
|
||||
$day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0;
|
||||
$month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0;
|
||||
$year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0;
|
||||
|
||||
if ((!$day || !$month || !$year) && !$field_data['field_required'])
|
||||
{
|
||||
@ -587,7 +587,7 @@ class custom_profile
|
||||
|
||||
$value = $this->get_var('int', $profile_row, $profile_row['field_default_value'], $preview);
|
||||
|
||||
if (!isset($this->options_lang[$profile_row['field_id']]) || !sizeof($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]))
|
||||
if (!isset($this->options_lang[$profile_row['field_id']]) || !isset($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]) || !sizeof($this->options_lang[$profile_row['field_id']][$profile_row['lang_id']]))
|
||||
{
|
||||
$this->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], FIELD_DROPDOWN, $preview);
|
||||
}
|
||||
@ -774,9 +774,9 @@ class custom_profile_admin extends custom_profile
|
||||
global $user;
|
||||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<input class="post" type="text" name="field_length" size="5" value="' . $this->vars['field_length'] . '" />'),
|
||||
1 => array('TITLE' => $user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input class="post" type="text" name="field_minlen" size="5" value="' . $this->vars['field_minlen'] . '" />'),
|
||||
2 => array('TITLE' => $user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input class="post" type="text" name="field_maxlen" size="5" value="' . $this->vars['field_maxlen'] . '" />'),
|
||||
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="text" name="field_length" size="5" value="' . $this->vars['field_length'] . '" />'),
|
||||
1 => array('TITLE' => $user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="text" name="field_minlen" size="5" value="' . $this->vars['field_minlen'] . '" />'),
|
||||
2 => array('TITLE' => $user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="text" name="field_maxlen" size="5" value="' . $this->vars['field_maxlen'] . '" />'),
|
||||
3 => array('TITLE' => $user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options() . '</select>')
|
||||
);
|
||||
|
||||
@ -788,9 +788,9 @@ class custom_profile_admin extends custom_profile
|
||||
global $user;
|
||||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<table border=0><tr><td><input name="rows" size="5" value="' . $this->vars['rows'] . '" class="post" /></td><td>[ ' . $user->lang['ROWS'] . ' ]</td></tr><tr><td><input name="columns" size="5" value="' . $this->vars['columns'] . '" class="post" /></td><td>[ ' . $user->lang['COLUMNS'] . ' ] <input type="hidden" name="field_length" value="' . $this->vars['field_length'] . '" /></td></tr></table>'),
|
||||
1 => array('TITLE' => $user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input class="post" type="text" name="field_minlen" size="10" value="' . $this->vars['field_minlen'] . '" />'),
|
||||
2 => array('TITLE' => $user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input class="post" type="text" name="field_maxlen" size="10" value="' . $this->vars['field_maxlen'] . '" />'),
|
||||
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<input name="rows" size="5" value="' . $this->vars['rows'] . '" /> ' . $user->lang['ROWS'] . '</dd><dd><input name="columns" size="5" value="' . $this->vars['columns'] . '" /> ' . $user->lang['COLUMNS'] . ' <input type="hidden" name="field_length" value="' . $this->vars['field_length'] . '" />'),
|
||||
1 => array('TITLE' => $user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="text" name="field_minlen" size="10" value="' . $this->vars['field_minlen'] . '" />'),
|
||||
2 => array('TITLE' => $user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="text" name="field_maxlen" size="10" value="' . $this->vars['field_maxlen'] . '" />'),
|
||||
3 => array('TITLE' => $user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options() . '</select>')
|
||||
);
|
||||
|
||||
@ -802,10 +802,10 @@ class custom_profile_admin extends custom_profile
|
||||
global $user;
|
||||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<input class="post" type="text" name="field_length" size="5" value="' . $this->vars['field_length'] . '" />'),
|
||||
1 => array('TITLE' => $user->lang['MIN_FIELD_NUMBER'], 'FIELD' => '<input class="post" type="text" name="field_minlen" size="5" value="' . $this->vars['field_minlen'] . '" />'),
|
||||
2 => array('TITLE' => $user->lang['MAX_FIELD_NUMBER'], 'FIELD' => '<input class="post" type="text" name="field_maxlen" size="5" value="' . $this->vars['field_maxlen'] . '" />'),
|
||||
3 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => '<input class="post" type="post" name="field_default_value" value="' . $this->vars['field_default_value'] . '" />')
|
||||
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="text" name="field_length" size="5" value="' . $this->vars['field_length'] . '" />'),
|
||||
1 => array('TITLE' => $user->lang['MIN_FIELD_NUMBER'], 'FIELD' => '<input type="text" name="field_minlen" size="5" value="' . $this->vars['field_minlen'] . '" />'),
|
||||
2 => array('TITLE' => $user->lang['MAX_FIELD_NUMBER'], 'FIELD' => '<input type="text" name="field_maxlen" size="5" value="' . $this->vars['field_maxlen'] . '" />'),
|
||||
3 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => '<input type="post" name="field_default_value" value="' . $this->vars['field_default_value'] . '" />')
|
||||
);
|
||||
|
||||
return $options;
|
||||
@ -888,7 +888,7 @@ class custom_profile_admin extends custom_profile
|
||||
);
|
||||
|
||||
$options = array(
|
||||
0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->generate_date($profile_row, true) . '<br /><input type="checkbox" name="always_now"' . ((isset($_REQUEST['always_now']) || $this->vars['field_default_value'] == 'now') ? ' checked="checked"' : '') . ' /> ' . $user->lang['ALWAYS_TODAY'])
|
||||
0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->generate_date($profile_row, true) . '</dd><dd><input type="checkbox" name="always_now"' . ((isset($_REQUEST['always_now']) || $this->vars['field_default_value'] == 'now') ? ' checked="checked"' : '') . ' /> ' . $user->lang['ALWAYS_TODAY'])
|
||||
);
|
||||
|
||||
return $options;
|
||||
|
@ -59,6 +59,7 @@ $lang += array(
|
||||
'ACP_CLIENT_COMMUNICATION' => 'Client Communication',
|
||||
'ACP_COOKIE_SETTINGS' => 'Cookie Settings',
|
||||
'ACP_CRITICAL_LOGS' => 'Error Log',
|
||||
'ACP_CUSTOM_PROFILE_FIELDS' => 'Custom Profile Fields',
|
||||
'ACP_DISALLOW' => 'Disallow',
|
||||
'ACP_DISALLOW_USERNAMES' => 'Disallow Usernames',
|
||||
'ACP_EMAIL_SETTINGS' => 'Email Settings',
|
||||
@ -88,6 +89,9 @@ $lang += array(
|
||||
'ACP_ORPHAN_ATTACHMENTS' => 'Orphan Attachments',
|
||||
'ACP_PERMISSION_SETTINGS' => 'Permission Settings',
|
||||
'ACP_PHP_INFO' => 'PHP Information',
|
||||
'ACP_PRUNE_FORUMS' => 'Prune Forums',
|
||||
'ACP_PRUNE_USERS' => 'Prune Users',
|
||||
'ACP_PRUNING' => 'Pruning',
|
||||
'ACP_RANKS' => 'Ranks',
|
||||
'ACP_SERVER_CONFIGURATION' => 'Server Configuration',
|
||||
'ACP_SERVER_SETTINGS' => 'Server Settings',
|
||||
@ -132,6 +136,7 @@ $lang += array(
|
||||
'LOGIN_ADMIN' => 'To administer the board you must be an authenticated user.',
|
||||
'LOGIN_ADMIN_CONFIRM' => 'To administer the board you must re-authenticate yourself.',
|
||||
'LOGIN_ADMIN_SUCCESS' => 'You have successfully authenticated and will now be redirected to the Administration Control Panel',
|
||||
'LOOK_UP_FORUM' => 'Select a Forum',
|
||||
|
||||
'MANAGE' => 'Manage',
|
||||
'MOVE_DOWN' => 'Move Down',
|
||||
@ -154,6 +159,8 @@ $lang += array(
|
||||
'UCP' => 'User Control Panel',
|
||||
'USERNAMES_EXPLAIN' => 'Place each username on a seperate line',
|
||||
'USER_CONTROL_PANEL' => 'User Control Panel',
|
||||
|
||||
'WARNING' => 'Warning',
|
||||
);
|
||||
|
||||
// PHP info
|
||||
@ -309,6 +316,18 @@ $lang += array(
|
||||
'LOG_MODULE_ADD' => '<b>Module added</b><br />» %s',
|
||||
'LOG_MODULE_EDIT' => '<b>Module edited</b><br />» %s',
|
||||
|
||||
'LOG_PROFILE_FIELD_ACTIVATE' => '<b>Profile field activated</b><br />» %s',
|
||||
'LOG_PROFILE_FIELD_CREATE' => '<b>Profile field added</b><br />» %s',
|
||||
'LOG_PROFILE_FIELD_DEACTIVATE' => '<b>Profile field deactivated</b><br />» %s',
|
||||
'LOG_PROFILE_FIELD_EDIT' => '<b>Profile field changed</b><br />» %s',
|
||||
'LOG_PROFILE_FIELD_REMOVED' => '<b>Profile field removed</b><br />» %s',
|
||||
|
||||
'LOG_PRUNE' => '<b>Pruned forums</b><br />» %s',
|
||||
'LOG_AUTO_PRUNE' => '<b>Auto-pruned forums</b><br />» %s',
|
||||
'LOG_PRUNE_USER_DEAC' => '<b>Users deactivated</b><br />» %s',
|
||||
'LOG_PRUNE_USER_DEL_DEL' => '<b>Users pruned and posts deleted</b><br />» %s',
|
||||
'LOG_PRUNE_USER_DEL_ANON' => '<b>Users pruned and posts retained</b><br />» %s',
|
||||
|
||||
'LOG_RESET_DATE' => '<b>Board start date reset</b>',
|
||||
'LOG_RESET_ONLINE' => '<b>Most users online reset</b>',
|
||||
'LOG_RESYNC_POSTCOUNTS' => '<b>User postcounts synced</b>',
|
||||
|
138
phpBB/language/en/acp/profile.php
Normal file
138
phpBB/language/en/acp/profile.php
Normal file
@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* acp_profile [English]
|
||||
*
|
||||
* @package language
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* DO NOT CHANGE
|
||||
*/
|
||||
if (empty($lang) || !is_array($lang))
|
||||
{
|
||||
$lang = array();
|
||||
}
|
||||
|
||||
// DEVELOPERS PLEASE NOTE
|
||||
//
|
||||
// Placeholders can now contain order information, e.g. instead of
|
||||
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
|
||||
// translators to re-order the output of data while ensuring it remains correct
|
||||
//
|
||||
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
|
||||
// equally where a string contains only two placeholders which are used to wrap text
|
||||
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
|
||||
|
||||
// Custom profile fields
|
||||
$lang += array(
|
||||
'ADDED_PROFILE_FIELD' => 'Successfully added custom profile field',
|
||||
'ALPHA_ONLY' => 'Alphanumeric only',
|
||||
'ALPHA_SPACERS' => 'Alphanumeric and spacers',
|
||||
'ALWAYS_TODAY' => 'Always the current date',
|
||||
|
||||
'BOOL_ENTRIES_EXPLAIN' => 'Enter your options now',
|
||||
'BOOL_TYPE_EXPLAIN' => 'Define the Type, either a checkbox or radio buttons',
|
||||
|
||||
'CHANGED_PROFILE_FIELD' => 'Successfully changed profile field',
|
||||
'CHARS_ANY' => 'Any character',
|
||||
'CHECKBOX' => 'Checkbox',
|
||||
'CP_LANG_DEFAULT_VALUE' => 'Default Value',
|
||||
'CP_LANG_EXPLAIN' => 'Field Description',
|
||||
'CP_LANG_EXPLAIN_EXPLAIN' => 'The Explanation for this field presented to the user',
|
||||
'CP_LANG_NAME' => 'Field Name presented to the user',
|
||||
'CP_LANG_OPTIONS' => 'Options',
|
||||
'CREATE_NEW_FIELD' => 'Create New Field',
|
||||
'COLUMNS' => 'Columns',
|
||||
|
||||
'DEFAULT_ISO_LANGUAGE' => 'Default Language [%s]',
|
||||
'DEFAULT_VALUE' => 'Default Value',
|
||||
'DELETE_PROFILE_FIELD' => 'Remove profile field',
|
||||
'DELETE_PROFILE_FIELD_CONFIRM' => 'Are you sure you want to delete this profile field?',
|
||||
'DISPLAY_AT_REGISTRATION' => 'Display at registration screen',
|
||||
'DROPDOWN_ENTRIES_EXPLAIN' => 'Enter your options now, every option in one line',
|
||||
|
||||
'EMPTY_FIELD_IDENT' => 'Empty field name',
|
||||
'EMPTY_USER_FIELD_NAME' => 'Empty Field Name presented to the user',
|
||||
'ENTRIES' => 'Entries',
|
||||
'EVERYTHING_OK' => 'Everything OK',
|
||||
'EXCLUDE_FROM_VIEW' => 'Do not display profile field',
|
||||
'EXCLUDE_FROM_VIEW_EXPLAIN' => 'The profile field will not be shown on viewtopic/viewprofile/memberlist/etc.',
|
||||
|
||||
'FIELD_BOOL' => 'Boolean (Yes/No)',
|
||||
'FIELD_DATE' => 'Date',
|
||||
'FIELD_DESCRIPTION' => 'Field Description',
|
||||
'FIELD_DESCRIPTION_EXPLAIN' => 'The Explanation for this field presented to the user',
|
||||
'FIELD_DROPDOWN' => 'Dropdown Box',
|
||||
'FIELD_IDENT' => 'Field Name',
|
||||
'FIELD_IDENT_EXPLAIN' => 'The Field Name is a name for you to identify the profile field, it is not displayed to the user.',
|
||||
'FIELD_INT' => 'Numbers',
|
||||
'FIELD_LENGTH' => 'Length of input box',
|
||||
'FIELD_NOT_FOUND' => 'Profile field not found',
|
||||
'FIELD_STRING' => 'Single Textfield',
|
||||
'FIELD_TEXT' => 'Textarea',
|
||||
'FIELD_TYPE' => 'Field Type',
|
||||
'FIELD_TYPE_EXPLAIN' => 'You are not able to change the field type later.',
|
||||
'FIELD_VALIDATION' => 'Field Validation',
|
||||
'FIRST_OPTION' => 'First Option',
|
||||
|
||||
'HIDE_PROFILE_FIELD' => 'Hide Profile Field',
|
||||
'HIDE_PROFILE_FIELD_EXPLAIN' => 'Only Administrators and Moderators are able to see/fill out this profile field',
|
||||
|
||||
'INVALID_CHARS_FIELD_IDENT' => 'Field name can only contain lowercase a-z and _',
|
||||
'ISO_LANGUAGE' => 'Language [%s]',
|
||||
|
||||
'LANG_SPECIFIC_OPTIONS' => 'Language specific options [<b>%s</b>]',
|
||||
|
||||
'MAX_FIELD_CHARS' => 'Maximum number of characters',
|
||||
'MAX_FIELD_NUMBER' => 'Highest allowed number',
|
||||
'MIN_FIELD_CHARS' => 'Minimum number of characters',
|
||||
'MIN_FIELD_NUMBER' => 'Lowest allowed number',
|
||||
|
||||
'NO_FIELD_ENTRIES' => 'No Entries defined',
|
||||
'NO_FIELD_ID' => 'No field id specified',
|
||||
'NO_FIELD_TYPE' => 'No Field type specified',
|
||||
'NO_VALUE_OPTION' => 'Option equal to non entered value',
|
||||
'NO_VALUE_OPTION_EXPLAIN' => 'Value for a non-entry. If the field is required, the user gets an error if he choose the option selected here',
|
||||
'NUMBERS_ONLY' => 'Only numbers (0-9)',
|
||||
|
||||
'PREVIEW_PROFILE_FIELD' => 'Preview Profile Field',
|
||||
'PROFILE_BASIC_OPTIONS' => 'Basic Options',
|
||||
'PROFILE_FIELD_ACTIVATED' => 'Profile field successfully activated',
|
||||
'PROFILE_FIELD_DEACTIVATED' => 'Profile field successfully deactivated',
|
||||
'PROFILE_LANG_OPTIONS' => 'Language specific options',
|
||||
'PROFILE_TYPE_OPTIONS' => 'Profile type specific options',
|
||||
|
||||
'RADIO_BUTTONS' => 'Radio Buttons',
|
||||
'REMOVED_PROFILE_FIELD' => 'Successfully removed profile field.',
|
||||
'REQUIRED_FIELD' => 'Required Field',
|
||||
'REQUIRED_FIELD_EXPLAIN' => 'Force profile field to be filled out or specified by user',
|
||||
'ROWS' => 'Rows',
|
||||
|
||||
'SAVE' => 'Save',
|
||||
'SECOND_OPTION' => 'Second Option',
|
||||
'STEP_1_EXPLAIN_CREATE' => 'Here you can enter the first basic parameters of your new profile field. These informations are needed for the second step where you are able to set remaining options and where you are able to preview and tweak your profile field further.',
|
||||
'STEP_1_EXPLAIN_EDIT' => 'Here you can change the basic parameters of your profile field. The relevant options are re-calculated within the second step, where you are able to preview and test the changed settings.',
|
||||
'STEP_1_TITLE_CREATE' => 'Add Profile Field',
|
||||
'STEP_1_TITLE_EDIT' => 'Edit Profile Field',
|
||||
'STEP_2_EXPLAIN_CREATE' => 'Here you are able to define some common options. Further you are able to preview the field you generated, as the user will see it. Play around with it until you are satisfied as how the field behaves.',
|
||||
'STEP_2_EXPLAIN_EDIT' => 'Here you are able to change some common options. Further you are able to preview the changed field, as the user will see it. Play around with it until you are satisfied as how the field behaves.<br /><b>Please note that changes to profile fields will not affect existing profile fields entered by your users.</b>',
|
||||
'STEP_2_TITLE_CREATE' => 'Profile type specific options',
|
||||
'STEP_2_TITLE_EDIT' => 'Profile type specific options',
|
||||
'STEP_3_EXPLAIN_CREATE' => 'Since you have more than one board language installed, you have to fill out the remaining language items too. The profile field will work with the default language enabled, you are able to fill out the remaining language items later too.',
|
||||
'STEP_3_EXPLAIN_EDIT' => 'Since you have more than one board language installed, you now can change or add the remaining language items too. The profile field will work with the default language enabled.',
|
||||
'STEP_3_TITLE_CREATE' => 'Remaining Language Definitions',
|
||||
'STEP_3_TITLE_EDIT' => 'Language Definitions',
|
||||
'STRING_DEFAULT_VALUE_EXPLAIN' => 'Enter a default phrase to be displayed, a default value. Leave empty if you want to show it empty at the first place.',
|
||||
|
||||
'TEXT_DEFAULT_VALUE_EXPLAIN' => 'Enter a default text to be displayed, a default value. Leave empty if you want to show it empty at the first place.',
|
||||
|
||||
'UPDATE_PREVIEW' => 'Update Preview',
|
||||
'USER_FIELD_NAME' => 'Field Name presented to the user',
|
||||
);
|
||||
|
||||
?>
|
77
phpBB/language/en/acp/prune.php
Normal file
77
phpBB/language/en/acp/prune.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* acp_prune [English]
|
||||
*
|
||||
* @package language
|
||||
* @version $Id$
|
||||
* @copyright (c) 2005 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* DO NOT CHANGE
|
||||
*/
|
||||
if (empty($lang) || !is_array($lang))
|
||||
{
|
||||
$lang = array();
|
||||
}
|
||||
|
||||
// DEVELOPERS PLEASE NOTE
|
||||
//
|
||||
// Placeholders can now contain order information, e.g. instead of
|
||||
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
|
||||
// translators to re-order the output of data while ensuring it remains correct
|
||||
//
|
||||
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
|
||||
// equally where a string contains only two placeholders which are used to wrap text
|
||||
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
|
||||
|
||||
// User pruning
|
||||
$lang += array(
|
||||
'ACP_PRUNE_USERS_EXPLAIN' => 'Here you can delete (or deactivate) users from you board. This can be done in a variety of ways; by post count, last activity, etc. Each of these criteria can be combined, i.e. you can prune users last active before 2002-01-01 with fewer than 10 posts. Alternatively you can enter a list of users directly into the text box, any criteria entered will be ignored. Take care with this facility! Once a user is deleted there is no way back.',
|
||||
|
||||
'DEACTIVATE' => 'Deactivate',
|
||||
'DEACTIVATE_DELETE' => 'Deactivate or delete',
|
||||
'DEACTIVATE_DELETE_EXPLAIN' => 'Choose whether to deactivate users or delete them entirely, note there is no undo!',
|
||||
'DELETE_USERS' => 'Delete',
|
||||
'DELETE_USER_POSTS' => 'Delete pruned user posts',
|
||||
'DELETE_USER_POSTS_EXPLAIN' => 'Removes posts made by deleted users, has no effect if users are deactivated.',
|
||||
|
||||
'JOINED_EXPLAIN' => 'Enter a date in YYYY-MM-DD format.',
|
||||
|
||||
'LAST_ACTIVE_EXPLAIN' => 'Enter a date in YYYY-MM-DD format.',
|
||||
|
||||
'SELECT_USERS_EXPLAIN' => 'Enter specific usernames here, they will be used in preference to the criteria above.',
|
||||
|
||||
'USER_DEACTIVATE_SUCCESS' => 'The selected users have been deactivated successfully',
|
||||
'USER_DELETE_SUCCESS' => 'The selected users have been deleted successfully',
|
||||
);
|
||||
|
||||
// Forum Pruning
|
||||
$lang += array(
|
||||
'ACP_PRUNE_FORUMS_EXPLAIN' => 'This will delete any topic which has not been posted to within the number of days you select. If you do not enter a number then all topics will be deleted. It will not remove topics in which polls are still running nor will it remove announcements. You will need to remove these topics manually.',
|
||||
|
||||
'FORUM_PRUNE' => 'Forum Prune',
|
||||
|
||||
'NO_PRUNE' => 'No forums pruned',
|
||||
|
||||
'SELECTED_FORUM' => 'Selected Forum',
|
||||
'SELECTED_FORUMS' => 'Selected Forums',
|
||||
|
||||
'POSTS_PRUNED' => 'Posts pruned',
|
||||
'PRUNE_ANNOUNCEMENTS' => 'Prune Announcements',
|
||||
'PRUNE_FINISHED_POLLS' => 'Prune Closed Polls',
|
||||
'PRUNE_FINISHED_POLLS_EXPLAIN' => 'Removes topics with polls which have ended.',
|
||||
'PRUNE_NOT_POSTED' => 'Days since last posted',
|
||||
'PRUNE_NOT_VIEWED' => 'Days since last viewed',
|
||||
'PRUNE_OLD_POLLS' => 'Prune Old Polls',
|
||||
'PRUNE_OLD_POLLS_EXPLAIN' => 'Removes topics with polls not voted in for post age days.',
|
||||
'PRUNE_STICKY' => 'Prune Stickies',
|
||||
'PRUNE_SUCCESS' => 'Pruning of forums was successful',
|
||||
|
||||
'TOPICS_PRUNED' => 'Topics pruned',
|
||||
);
|
||||
|
||||
?>
|
@ -214,18 +214,21 @@ switch ($mode)
|
||||
/**
|
||||
* Functions used to generate additional URL paramters
|
||||
*/
|
||||
function main_forum_view_url()
|
||||
function _module_main_forum_view_url()
|
||||
{
|
||||
return extra_url();
|
||||
}
|
||||
function main_topic_view_url()
|
||||
|
||||
function _module_main_topic_view_url()
|
||||
{
|
||||
return extra_url();
|
||||
}
|
||||
function main_post_details_url()
|
||||
|
||||
function _module_main_post_details_url()
|
||||
{
|
||||
return extra_url();
|
||||
}
|
||||
|
||||
function extra_url()
|
||||
{
|
||||
global $forum_id, $topic_id, $post_id;
|
||||
@ -236,9 +239,6 @@ function extra_url()
|
||||
return $url_extra;
|
||||
}
|
||||
|
||||
//
|
||||
// LITTLE HELPER
|
||||
|
||||
/**
|
||||
* Get simple topic data
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user