Enable group based avatar ... really not sure about the api layout though

git-svn-id: file:///svn/phpbb/trunk@4621 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2003-10-21 16:45:33 +00:00
parent df24e3c8e0
commit 7c68d87f21
4 changed files with 220 additions and 86 deletions

View file

@ -54,6 +54,7 @@ $start = request_var('start', 0);
// Clear some vars // Clear some vars
$group_type = $group_name = $group_desc = $group_colour = $group_rank = $group_avatar = false; $group_type = $group_name = $group_desc = $group_colour = $group_rank = $group_avatar = false;
$can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
// Grab basic data for group, if group_id is set and exists // Grab basic data for group, if group_id is set and exists
if ($group_id) if ($group_id)
@ -113,7 +114,21 @@ switch ($mode)
trigger_error($user->lang[$error]); trigger_error($user->lang[$error]);
} }
$message = ($action == 'demote') ? 'GROUP_MODS_DEMOTED' : (($action == 'deleteusers') ? 'GROUP_USERS_REMOVE' : 'GROUP_DELETED'); switch ($action)
{
case 'demote':
$message = 'GROUP_MODS_DEMOTED';
break;
case 'promote':
$message = 'GROUP_MODS_PROMOTED';
break;
case 'delete':
$message = 'GROUP_DELETED';
break;
case 'deleteusers':
$message = 'GROUP_USERS_REMOVE';
break;
}
trigger_error($user->lang[$message]); trigger_error($user->lang[$message]);
break; break;
@ -150,7 +165,7 @@ switch ($mode)
// Did we submit? // Did we submit?
if ($update) if ($update)
{ {
if (!($error = create_group($action, $group_id, $group_type, $group_name, $group_description, $group_colour, $group_rank, $group_avatar))) if (!($error = create_group($action, $group_id, $group_type, $group_name, $group_description, $group_colour, $group_rank, $group_avatar, $group_avatar_type, $group_avatar_width, $group_avatar_height)))
{ {
$message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED'; $message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED';
trigger_error($message); trigger_error($message);
@ -194,6 +209,26 @@ switch ($mode)
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : ''; $type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : ''; $type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
if ($group_avatar)
{
switch ($group_avatar_type)
{
case AVATAR_UPLOAD:
$avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
break;
case AVATAR_GALLERY:
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
}
$avatar_img .= $group_avatar;
$avatar_img = '<img src="' . $avatar_img . '" width="' . $group_avatar_width . '" height="' . $group_avatar_height . '" border="0" alt="" />';
}
else
{
$avatar_img = '<img src="images/no_avatar.gif" alt="" />';
}
?> ?>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
@ -208,7 +243,7 @@ function swatch()
//--> //-->
</script> </script>
<form name="settings" method="post" action="admin_groups.<?php echo "$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;g=$group_id"; ?>"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center"> <form name="settings" method="post" action="<?php echo "admin_groups.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;g=$group_id"; ?>"<?php echo ($can_upload) ? ' enctype="multipart/form-data"' : ''; ?>><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $user->lang['GROUP_DETAILS']; ?></th> <th colspan="2"><?php echo $user->lang['GROUP_DETAILS']; ?></th>
</tr> </tr>
@ -279,43 +314,61 @@ function swatch()
<th colspan="2"><?php echo $user->lang['GROUP_AVATAR']; ?></th> <th colspan="2"><?php echo $user->lang['GROUP_AVATAR']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}: </b><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td> <td class="row2" width="35%"><b><?php echo $user->lang['CURRENT_IMAGE']; ?>: </b><br /><span class="gensmall"><?php echo sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)); ?></span></td>
<td class="row2" align="center"><br /><!-- IF AVATAR -->{AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --><br /><br /><input type="checkbox" name="delete" />&nbsp;<span class="gensmall">{L_DELETE_AVATAR}</span></td> <td class="row1" align="center"><br /><?php echo $avatar_img; ?><br /><br /><input type="checkbox" name="delete" />&nbsp;<span class="gensmall"><?php echo $user->lang['DELETE_AVATAR']; ?></span></td>
</tr> </tr>
<!-- IF S_UPLOAD_AVATAR_FILE --> <?php
// Can we upload?
if ($can_upload)
{
?>
<tr> <tr>
<td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_FILE}: </b></td> <td class="row2" width="35%"><b><?php echo $user->lang['UPLOAD_AVATAR_FILE']; ?>: </b></td>
<td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input class="post" type="file" name="uploadfile" /></td> <td class="row1"><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $config['avatar_max_filesize']; ?>" /><input class="post" type="file" name="uploadfile" /></td>
</tr>
<!-- ENDIF -->
<!-- IF S_UPLOAD_AVATAR_URL -->
<tr>
<td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_URL}: </b><br /><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" name="uploadurl" size="40" value="{AVATAR_URL}" /></td>
</tr>
<!-- ENDIF -->
<!-- IF S_LINK_AVATAR -->
<tr>
<td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_AVATAR}: </b><br /><span class="gensmall">{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" name="remotelink" size="40" value="{AVATAR_REMOTE}" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_SIZE}: </b><br /><span class="gensmall">{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td> <td class="row2" width="35%"><b><?php echo $user->lang['UPLOAD_AVATAR_URL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['UPLOAD_AVATAR_URL_EXPLAIN']; ?></span></td>
<td class="row2"><input class="post" type="text" name="width" size="3" value="{WIDTH}" /> <span class="gen">px X </span> <input class="post" type="text" name="height" size="3" value="{HEIGHT}" /> <span class="gen">px</span></td> <td class="row1"><input class="post" type="text" name="uploadurl" size="40" value="<?php echo $avatar_url; ?>" /></td>
</tr> </tr>
<!-- ENDIF --> <?php
<!-- IF S_GALLERY_AVATAR -->
}
?>
<tr> <tr>
<td class="row1" width="35%"><b class="genmed">{L_AVATAR_GALLERY}: </b></td> <td class="row2" width="35%"><b><?php echo $user->lang['LINK_REMOTE_AVATAR']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['LINK_REMOTE_AVATAR_EXPLAIN']; ?></span></td>
<td class="row2"><input class="btnlite" type="submit" name="displaygallery" value="{L_DISPLAY_GALLERY}" /></td> <td class="row1"><input class="post" type="text" name="remotelink" size="40" value="<?php echo $avatar_url; ?>" /></td>
</tr>
<!-- ENDIF -->
<!-- IF S_DISPLAY_GALLERY -->
<tr>
<th colspan="2">{L_AVATAR_GALLERY}</th>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center" valign="middle"><span class="genmed">{L_AVATAR_CATEGORY}: </span><select name="avatarcat">{S_CAT_OPTIONS}</select>&nbsp; <span class="genmed">{L_AVATAR_PAGE}: </span><select name="avatarpage">{S_PAGE_OPTIONS}</select>&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="avatargallery" /></td> <td class="row2" width="35%"><b><?php echo $user->lang['LINK_REMOTE_SIZE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['LINK_REMOTE_SIZE_EXPLAIN']; ?></span></td>
<td class="row1"><input class="post" type="text" name="width" size="3" value="<?php echo $group_avatar_width; ?>" /> <span class="gen">px X </span> <input class="post" type="text" name="height" size="3" value="<?php echo $group_avatar_height; ?>" /> <span class="gen">px</span></td>
</tr>
<?php
// Do we have a gallery?
if ($config['null'] && !$display_gallery)
{
?>
<tr>
<td class="row2" width="35%"><b><?php echo $user->lang['AVATAR_GALLERY']; ?>: </b></td>
<td class="row1"><input class="btnlite" type="submit" name="displaygallery" value="<?php echo $user->lang['DISPLAY_GALLERY']; ?>" /></td>
</tr>
<?php
}
// Do we want to display it?
if ($config['null'] && $display_gallery)
{
?>
<tr>
<th colspan="2"><?php echo $user->lang['AVATAR_GALLERY']; ?></th>
</tr>
<tr>
<td class="cat" colspan="2" align="center" valign="middle"><span class="genmed"><?php echo $user->lang['AVATAR_CATEGORY']; ?>: </span><select name="avatarcat">{S_CAT_OPTIONS}</select>&nbsp; <span class="genmed"><?php echo $user->lang['AVATAR_PAGE']; ?>: </span><select name="avatarpage">{S_PAGE_OPTIONS}</select>&nbsp;<input class="btnlite" type="submit" value="<?php echo $user->lang['GO']; ?>" name="avatargallery" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1" colspan="2" align="center"><table cellspacing="1" cellpadding="4" border="0"> <td class="row1" colspan="2" align="center"><table cellspacing="1" cellpadding="4" border="0">
@ -335,7 +388,11 @@ function swatch()
</table></td> </table></td>
</tr> </tr>
<!-- ENDIF --> <?php
}
?>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" /> &nbsp; <input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td> <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" /> &nbsp; <input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
</tr> </tr>
@ -458,7 +515,7 @@ function swatch()
?> ?>
<tr> <tr>
<td class="row3" colspan="5"><b>Approved Members</b></td> <td class="row3" colspan="5"><b><?php echo $user->lang['GROUP_APPROVED']; ?></b></td>
</tr> </tr>
<?php <?php
if (sizeof($group_data['member'])) if (sizeof($group_data['member']))
@ -472,7 +529,7 @@ function swatch()
?> ?>
<tr> <tr>
<td class="row3" colspan="5"><b>Pending Members</b></td> <td class="row3" colspan="5"><b><?php echo $user->lang['GROUP_PENDING']; ?></b></td>
</tr> </tr>
<?php <?php
@ -505,7 +562,14 @@ function swatch()
?> ?>
<tr> <tr>
<td class="cat" colspan="5" align="right"><?php echo $user->lang['SELECT_OPTION']; ?>: <select name="action"><option value="approve">Approve</option><option value="default">Default</option><option value="promote">Promote</option><option value="demote">Demote</option><option value="deleteusers">Delete</option></select> <input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;</td> <td class="cat" colspan="5" align="right"><?php echo $user->lang['SELECT_OPTION']; ?>: <select name="action"><option value="">----------</option><?php
foreach(array('default' => 'DEFAULT', 'approve' => 'APPROVE', 'demote' => 'DEMOTE', 'promote' => 'PROMOTE', 'deleteusers' => 'DELETE') as $option => $lang)
{
echo '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
}
?></select> <input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;</td>
</tr> </tr>
</table> </table>
@ -599,7 +663,7 @@ function swatch()
?> ?>
<tr> <tr>
<td class="cat" colspan="5" align="right">Create new group: <input class="post" type="text" name="group_name" maxlength="30" /> <input class="btnmain" type="submit" name="add" value="<?php echo $user->lang['SUBMIT']; ?>" /></td> <td class="cat" colspan="5" align="right"><?php echo $user->lang['CREATE_GROUP']; ?>: <input class="post" type="text" name="group_name" maxlength="30" /> <input class="btnmain" type="submit" name="add" value="<?php echo $user->lang['SUBMIT']; ?>" /></td>
</tr> </tr>
</table> </table>

View file

@ -234,13 +234,13 @@ function update_username($old_name, $new_name)
$db->sql_query($sql); $db->sql_query($sql);
} }
function avatar_delete() function avatar_delete($id)
{ {
global $config, $db, $user; global $phpbb_root_path, $config, $db, $user;
if (file_exists('./' . $config['avatar_path'] . '/' . $user->data['user_avatar'])) if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . $id))
{ {
@unlink('./' . $config['avatar_path'] . '/' . $user->data['user_avatar']); @unlink($phpbb_root_path . $config['avatar_path'] . '/' . $id);
} }
return false; return false;
@ -294,7 +294,7 @@ function avatar_remote($data, &$error)
function avatar_upload($data, &$error) function avatar_upload($data, &$error)
{ {
global $config, $db, $user; global $phpbb_root_path, $config, $db, $user;
if (!empty($_FILES['uploadfile']['tmp_name'])) if (!empty($_FILES['uploadfile']['tmp_name']))
{ {
@ -634,10 +634,12 @@ function add_to_group($action, $group_id, $user_id_ary, $username_ary, $leader,
function create_group($action, $group_id, &$type, &$name, &$desc, &$colour, &$rank, &$avatar) function create_group($action, $group_id, &$type, &$name, &$desc, &$colour, &$rank, &$avatar)
{ {
global $db, $user; global $phpbb_root_path, $config, $db, $user;
$error = array(); $error = array();
$can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
if (isset($type) && $type != GROUP_SPECIAL) if (isset($type) && $type != GROUP_SPECIAL)
{ {
$name = request_var('group_name', ''); $name = request_var('group_name', '');
@ -645,9 +647,14 @@ function create_group($action, $group_id, &$type, &$name, &$desc, &$colour, &$ra
} }
$desc = request_var('group_description', ''); $desc = request_var('group_description', '');
$colour2 = request_var('group_colour', ''); $colour2 = request_var('group_colour', '');
$avatar2 = request_var('group_avatar', '');
$rank2 = request_var('group_rank', 0); $rank2 = request_var('group_rank', 0);
$data['uploadurl'] = request_var('uploadurl', '');
$data['remotelink'] = request_var('remotelink', '');
$data['width'] = request_var('width', '');
$data['height'] = request_var('height', '');
$delete = request_var('delete', '');
// Check data // Check data
if (!strlen($name) || strlen($name) > 40) if (!strlen($name) || strlen($name) > 40)
{ {
@ -664,9 +671,37 @@ function create_group($action, $group_id, &$type, &$name, &$desc, &$colour, &$ra
$error[] = $user->lang['GROUP_ERR_TYPE']; $error[] = $user->lang['GROUP_ERR_TYPE'];
} }
// Update DB // Avatar stuff
$var_ary = array(
'uploadurl' => array('string', true, 5, 255),
'remotelink' => array('string', true, 5, 255),
'width' => array('string', true, 1, 3),
'height' => array('string', true, 1, 3),
);
$error = validate_data($data, $var_ary);
if (!sizeof($error)) if (!sizeof($error))
{ {
$data['user_id'] = "g$group_id";
if (!empty($_FILES['uploadfile']['tmp_name']) && $can_upload)
{
$data = avatar_upload($data, $error);
}
else if ($data['uploadurl'] && $can_upload)
{
$data = avatar_upload($data, $error);
}
else if ($data['remotelink'])
{
$data = avatar_remote($data, $error);
}
else if ($delete)
{
$data['filename'] = $data['width'] = $data['height'] = '';
}
// Update group preferences // Update group preferences
$sql_ary = array( $sql_ary = array(
'group_name' => (string) $name, 'group_name' => (string) $name,
@ -674,21 +709,35 @@ function create_group($action, $group_id, &$type, &$name, &$desc, &$colour, &$ra
'group_type' => (int) $type, 'group_type' => (int) $type,
'group_rank' => (int) $rank2, 'group_rank' => (int) $rank2,
'group_colour' => (string) $colour2, 'group_colour' => (string) $colour2,
'group_avatar' => (string) $data['filename'],
'group_avatar_type' => (int) $data['type'],
'group_avatar_width' => (int) $data['width'],
'group_avatar_height' => (int) $data['height'],
); );
$sql = ($action == 'edit' && $group_id) ? 'UPDATE ' . GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE group_id = $group_id" : 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $sql = ($action == 'edit' && $group_id) ? 'UPDATE ' . GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE group_id = $group_id" : 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql); $db->sql_query($sql);
if ($group_id && ($colour != $colour2 || $rank != $rank2 || $avatar != $avatar2)) if ($group_id && ($colour != $colour2 || $rank != $rank2 || $avatar != $data['filename']))
{ {
$sql_ary = array( $sql_ary = array(
'user_rank' => (string) $rank2, 'user_rank' => (string) $rank2,
'user_colour' => (string) $colour2, 'user_colour' => (string) $colour2,
'user_avatar' => (string) $data['filename'],
'user_avatar_type' => (int) $data['type'],
'user_avatar_width' => (int) $data['width'],
'user_avatar_height'=> (int) $data['height'],
); );
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE group_id = $group_id"; WHERE group_id = $group_id";
$db->sql_query($sql); $db->sql_query($sql);
// Delete old avatar if present
if ($avatar != '' && $avatar != $data['filename'])
{
avatar_delete($avatar);
}
} }
if (!function_exists('add_log')) if (!function_exists('add_log'))
@ -836,16 +885,15 @@ function approve_user($group_id, $user_id_ary, $username_ary, &$group_name)
return false; return false;
} }
// If user_id or username_ary are set users are deleted, else group is // Setting action to demote true will demote leaders to users
// removed. Setting action to demote true will demote leaders to users
// (if appropriate), deleting leaders removes them from group as with // (if appropriate), deleting leaders removes them from group as with
// normal users // normal users
function group_memberships($action, $id, $user_id_ary, $username_ary, &$group_name) function group_memberships($action, $id, $user_id_ary, $username_ary, &$group_name)
{ {
global $db; global $db;
// If no user_id or username data is submitted we'll delete the entire group // If no user_id or username data is submitted we'll act the entire group
if (!$user_id_ary && !$username_ary) if ($action == 'delete' && !$user_id_ary && !$username_ary)
{ {
$sql = 'SELECT user_id $sql = 'SELECT user_id
FROM ' . USER_GROUP_TABLE . " FROM ' . USER_GROUP_TABLE . "
@ -896,6 +944,8 @@ function group_memberships($action, $id, $user_id_ary, $username_ary, &$group_na
WHERE user_id IN (' . implode(', ', $id_ary) . ") WHERE user_id IN (' . implode(', ', $id_ary) . ")
AND group_id = $id"; AND group_id = $id";
$db->sql_query($sql); $db->sql_query($sql);
$log = 'LOG_GROUP_DEMOTED';
break; break;
case 'promote': case 'promote':
@ -904,9 +954,12 @@ function group_memberships($action, $id, $user_id_ary, $username_ary, &$group_na
WHERE user_id IN (' . implode(', ', $id_ary) . ") WHERE user_id IN (' . implode(', ', $id_ary) . ")
AND group_id = $id"; AND group_id = $id";
$db->sql_query($sql); $db->sql_query($sql);
$log = 'LOG_GROUP_PROMOTED';
break; break;
default: case 'delete':
case 'deleteusers':
$group_order = array('ADMINISTRATORS', 'SUPER_MODERATORS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS', 'GUESTS'); $group_order = array('ADMINISTRATORS', 'SUPER_MODERATORS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS', 'GUESTS');
$sql = 'SELECT * $sql = 'SELECT *
@ -971,11 +1024,25 @@ function group_memberships($action, $id, $user_id_ary, $username_ary, &$group_na
} }
unset($default_group_ary); unset($default_group_ary);
if ($action == 'delete')
{
$sql = 'DELETE FROM ' . GROUPS_TABLE . "
WHERE group_id = $db";
$db->sql_query($sql);
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . "
WHERE group_id = $id";
}
else
{
$sql = 'DELETE FROM ' . USER_GROUP_TABLE . " $sql = 'DELETE FROM ' . USER_GROUP_TABLE . "
WHERE group_id = $id WHERE group_id = $id
AND user_id IN (" . implode(', ', array_keys($default_ary)) . ')'; AND user_id IN (" . implode(', ', array_keys($default_ary)) . ')';
}
$db->sql_query($sql); $db->sql_query($sql);
unset($default_ary); unset($default_ary);
$log = ($action == 'deleteusers') ? 'LOG_GROUP_REMOVE' : 'LOG_GROUP_DELETED';
break; break;
} }
@ -985,7 +1052,6 @@ function group_memberships($action, $id, $user_id_ary, $username_ary, &$group_na
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
} }
$log = ($action == 'demote') ? 'LOG_GROUP_DEMOTED' : (($action == 'deleteusers') ? 'LOG_GROUP_REMOVE' : 'LOG_GROUP_DELETED');
add_log('admin', $log, $group_name, implode(', ', $username_ary)); add_log('admin', $log, $group_name, implode(', ', $username_ary));
return false; return false;

View file

@ -246,14 +246,16 @@ CREATE TABLE phpbb_forums_watch (
CREATE TABLE phpbb_groups ( CREATE TABLE phpbb_groups (
group_id mediumint(8) NOT NULL auto_increment, group_id mediumint(8) NOT NULL auto_increment,
group_type tinyint(4) DEFAULT '1' NOT NULL, group_type tinyint(4) DEFAULT '1' NOT NULL,
group_name varchar(40) NOT NULL, group_name varchar(40) DEFAULT '' NOT NULL,
group_display tinyint(1) DEFAULT '0' NOT NULL, group_display tinyint(1) DEFAULT '0' NOT NULL,
group_avatar varchar(100), group_avatar varchar(100) DEFAULT '' NOT NULL,
group_avatar_type tinyint(4), group_avatar_type tinyint(4) DEFAULT '0' NOT NULL,
group_rank int(11) DEFAULT '0', group_avatar_width tinyint(4 UNSIGNED DEFAULT '0' NOT NULL,
group_avatar_height tinyint(4) UNSIGNED DEFAULT '0' NOT NULL,
group_rank smallint(5) DEFAULT '-1' NOT NULL,
group_colour varchar(6) DEFAULT '' NOT NULL, group_colour varchar(6) DEFAULT '' NOT NULL,
group_chgpass smallint(6) DEFAULT '0' NOT NULL, group_chgpass smallint(6) DEFAULT '0' NOT NULL,
group_description varchar(255) NOT NULL, group_description varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (group_id) PRIMARY KEY (group_id)
); );

View file

@ -185,8 +185,9 @@ $lang += array(
'LOG_GROUP_DEFAULTS' => '<b>Group made default for members</b><br />&#187; %s', 'LOG_GROUP_DEFAULTS' => '<b>Group made default for members</b><br />&#187; %s',
'LOG_USERS_APPROVED' => '<b>Users approved in usergroup</b> %s<br />&#187; %s', 'LOG_USERS_APPROVED' => '<b>Users approved in usergroup</b> %s<br />&#187; %s',
'LOG_GROUP_DEMOTED' => '<b>Leaders demoted in usergroup</b> %s<br />&#187; %s', 'LOG_GROUP_DEMOTED' => '<b>Leaders demoted in usergroup</b> %s<br />&#187; %s',
'LOG_GROUP_PROMOTED' => '<b>Users promoted to leader in usergroup</b> %s<br />&#187; %s',
'LOG_GROUP_REMOVE' => '<b>Users removed from usergroup</b> %s<br />&#187; %s', 'LOG_GROUP_REMOVE' => '<b>Users removed from usergroup</b> %s<br />&#187; %s',
'LOG_GROUP_DEMOTED' => '<b>Usergroup deleted</b><br />&#187; %s', 'LOG_GROUP_DELETED' => '<b>Usergroup deleted</b><br />&#187; %s',
'LOG_ADD_STYLE' => '<b>Added new style</b><br />&#187; %s', 'LOG_ADD_STYLE' => '<b>Added new style</b><br />&#187; %s',
'LOG_EDIT_STYLE' => '<b>Edited style</b><br />&#187; %s', 'LOG_EDIT_STYLE' => '<b>Edited style</b><br />&#187; %s',
@ -1017,24 +1018,28 @@ $lang += array(
'USER_DEF_GROUPS' => 'User defined groups', 'USER_DEF_GROUPS' => 'User defined groups',
'USER_DEF_GROUPS_EXPLAIN' => 'These are groups created by you or another admin on this board. You can manage memberships as well as edit group properties or even delete the group. By clicking "Default" you can set the relevant group to the default for all its members.', 'USER_DEF_GROUPS_EXPLAIN' => 'These are groups created by you or another admin on this board. You can manage memberships as well as edit group properties or even delete the group. By clicking "Default" you can set the relevant group to the default for all its members.',
'SPECIAL_GROUPS' => 'Special groups', 'SPECIAL_GROUPS' => 'Predefined groups',
'SPECIAL_GROUPS_EXPLAIN' => 'These are pre-defined groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings. By clicking "Default" you can set the relevant group to the default for all its members.', 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings. By clicking "Default" you can set the relevant group to the default for all its members.',
'TOTAL_MEMBERS' => 'Members', 'TOTAL_MEMBERS' => 'Members',
'GROUP_DEFS_UPDATED' => 'Default group set for all members', 'GROUP_DEFS_UPDATED' => 'Default group set for all members',
'CREATE_GROUP' => 'Create new group',
'ADD_NEW_GROUP' => 'Create new group',
'GROUP_LIST' => 'Current members', 'GROUP_LIST' => 'Current members',
'GROUP_LIST_EXPLAIN' => 'This is a complete list of all the current users with membership of this group. You can delete members (except in certain special groups) or add new ones as you see fit.', 'GROUP_LIST_EXPLAIN' => 'This is a complete list of all the current users with membership of this group. You can delete members (except in certain special groups) or add new ones as you see fit.',
'GROUP_MEMBERS' => 'Group members', 'GROUP_MEMBERS' => 'Group members',
'GROUP_MEMBERS_EXPLAIN' => 'This is a complete listing of all the members of this usergroup. It includes seperate sections for leaders, pending and existing members. From here you can manage all aspects of who has membership of this group and what their role is. To remove a leader but keep them in the group use Demote rather than delete. Similarly use Promote to make an existing member a leader.', 'GROUP_MEMBERS_EXPLAIN' => 'This is a complete listing of all the members of this usergroup. It includes seperate sections for leaders, pending and existing members. From here you can manage all aspects of who has membership of this group and what their role is. To remove a leader but keep them in the group use Demote rather than delete. Similarly use Promote to make an existing member a leader.',
'GROUP_LEAD' => 'Group leaders', 'GROUP_LEAD' => 'Group leaders',
'GROUP_PENDING' => 'Pending Users', 'GROUP_APPROVED' => 'Approved Members',
'GROUP_PENDING' => 'Pending Members',
'GROUPS_NO_MEMBERS' => 'This group has no members', 'GROUPS_NO_MEMBERS' => 'This group has no members',
'GROUPS_NO_MODS' => 'No group leaders defined', 'GROUPS_NO_MODS' => 'No group leaders defined',
'SELECT_OPTION' => 'Select option', 'SELECT_OPTION' => 'Select option',
'GROUP_DEFAULT' => 'Default',
'GROUP_APPROVE' => 'Approve',
'GROUP_PROMOTE' => 'Promote',
'GROUP_DEMOTE' => 'Demote',
'GROUP_DELETE' => 'Delete',
'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a seperate line.', 'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a seperate line.',
'USER_DEFAULT' => 'User default', 'USER_DEFAULT' => 'User default',
'USER_GROUP_DEFAULT' => 'Set as default group', 'USER_GROUP_DEFAULT' => 'Set as default group',
@ -1045,8 +1050,7 @@ $lang += array(
'GROUP_MODS_ADDED' => 'New group moderators added successfully.', 'GROUP_MODS_ADDED' => 'New group moderators added successfully.',
'USERS_APPROVED' => 'Users approved successfully.', 'USERS_APPROVED' => 'Users approved successfully.',
'GROUP_EDIT_EXPLAIN' => 'Here you can edit an existing group. You can change its name, description and type (open, closed, etc.). You can also set certain groupwide options such as colouration, rank, etc. Changes made here override users current settings.',
'GROUP_EDIT_EXPLAIN' => 'Here you can edit an existing group. You can change its name, description and type (open, closed, etc.). You can also set certain groupwide options such as colouration, rank, etc. Please note that colours can be altered by individual users if they have appropriate permissions. Changes made here override users current settings.',
'GROUP_DETAILS' => 'Group details', 'GROUP_DETAILS' => 'Group details',
'GROUP_NAME' => 'Group name', 'GROUP_NAME' => 'Group name',
'GROUP_DESC' => 'Group description', 'GROUP_DESC' => 'Group description',
@ -1065,7 +1069,6 @@ $lang += array(
'GROUP_UPDATED' => 'Group preferences updated successfully.', 'GROUP_UPDATED' => 'Group preferences updated successfully.',
'GROUP_CREATED' => 'Group has been created successfully', 'GROUP_CREATED' => 'Group has been created successfully',
'GROUP_SETTINGS_SAVE' => 'Groupwide settings', 'GROUP_SETTINGS_SAVE' => 'Groupwide settings',
'GROUP_SETTINGS' => 'Set user preferences', 'GROUP_SETTINGS' => 'Set user preferences',
'GROUP_SETTINGS_EXPLAIN' => 'Here you can force changes in users current preferences. Please note these settings are not saved for the group itself. They are intended as a quick method of altering the preferences of all users in this group.', 'GROUP_SETTINGS_EXPLAIN' => 'Here you can force changes in users current preferences. Please note these settings are not saved for the group itself. They are intended as a quick method of altering the preferences of all users in this group.',
@ -1073,12 +1076,11 @@ $lang += array(
'GROUP_TIMEZONE' => 'Group timezone', 'GROUP_TIMEZONE' => 'Group timezone',
'GROUP_DST' => 'Group daylight savings', 'GROUP_DST' => 'Group daylight savings',
'GROUP_MODS_DEMOTED' => 'Group leaders demoted successfully', 'GROUP_MODS_DEMOTED' => 'Group leaders demoted successfully',
'GROUP_MODS_PROMOTED' => 'Group members promoted successfully',
'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully', 'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully',
'GROUP_DELETED' => 'Group deleted and user default groups set successfully', 'GROUP_DELETED' => 'Group deleted and user default groups set successfully',
'GROUP_ERR_USERNAME' => 'No group name specified.', 'GROUP_ERR_USERNAME' => 'No group name specified.',
'GROUP_ERR_USER_LONG' => 'Group name too long.', 'GROUP_ERR_USER_LONG' => 'Group name too long.',
'GROUP_ERR_DESC_LONG' => 'Group description too long.', 'GROUP_ERR_DESC_LONG' => 'Group description too long.',