本文整理汇总了PHP中group_select_options函数的典型用法代码示例。如果您正苦于以下问题:PHP group_select_options函数的具体用法?PHP group_select_options怎么用?PHP group_select_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了group_select_options函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display_options
/**
* Display the options a user can configure for this extension
*
* @return null
* @access public
*/
public function display_options()
{
// Create a form key for preventing CSRF attacks
$form_key = 'login_redirect';
add_form_key($form_key);
// Is the form being submitted
if ($this->request->is_set_post('submit')) {
// Is the submitted form is valid
if (!check_form_key($form_key)) {
trigger_error($this->user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
}
// Check that the entered topics are valid
$this->topic_valid($this->request->variable('redirect_announce_topic_id', ''), $this->user->lang('INVALID_ANNOUNCEMENT_TOPIC'));
$this->topic_valid($this->request->variable('redirect_welcome_topic_id', ''), $this->user->lang('INVALID_WELCOME_TOPIC'));
$this->topic_valid($this->request->variable('redirect_group_topic_id', ''), $this->user->lang('INVALID_GROUP_TOPIC'));
// If no errors, process the form data
// Set the options the user configured
$this->set_options();
// Add option settings change action to the admin log
$phpbb_log = $this->container->get('log');
$phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_LOGIN_REDIRECT');
// Option settings have been updated and logged
// Confirm this to the user and provide link back to previous page
trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
}
// Set output vars for display in the template
$this->template->assign_vars(array('REDIRECT_ANNOUNCE' => isset($this->config['redirect_announce']) ? $this->config['redirect_announce'] : '', 'REDIRECT_ANNOUNCE_PRIORITY' => isset($this->config['redirect_announce_priority']) ? $this->config['redirect_announce_priority'] : '', 'REDIRECT_ANNOUNCE_REFRESH' => isset($this->config['redirect_announce_refresh']) ? $this->config['redirect_announce_refresh'] : '', 'REDIRECT_ANNOUNCE_TOPIC_ID' => isset($this->config['redirect_announce_topic_id']) ? $this->config['redirect_announce_topic_id'] : '', 'REDIRECT_ANY_ANNOUNCE' => isset($this->config['redirect_any_announce']) ? $this->config['redirect_any_announce'] : '', 'REDIRECT_ENABLED' => isset($this->config['redirect_enabled']) ? $this->config['redirect_enabled'] : '', 'REDIRECT_GROUP' => isset($this->config['redirect_group']) ? $this->config['redirect_group'] : '', 'REDIRECT_GROUP_ALL' => isset($this->config['redirect_group_all']) ? $this->config['redirect_group_all'] : '', 'REDIRECT_GROUP_REFRESH' => isset($this->config['redirect_group_refresh']) ? $this->config['redirect_group_refresh'] : '', 'REDIRECT_GROUP_TOPIC_ID' => isset($this->config['redirect_group_topic_id']) ? $this->config['redirect_group_topic_id'] : '', 'REDIRECT_WELCOME' => isset($this->config['redirect_welcome']) ? $this->config['redirect_welcome'] : '', 'REDIRECT_WELCOME_REFRESH' => isset($this->config['redirect_welcome_refresh']) ? $this->config['redirect_welcome_refresh'] : '', 'REDIRECT_WELCOME_TOPIC_ID' => isset($this->config['redirect_welcome_topic_id']) ? $this->config['redirect_welcome_topic_id'] : '', 'S_REDIRECT_GROUP_OPTIONS' => group_select_options($this->config['redirect_group_id'], false, false), 'U_ACTION' => $this->u_action));
}
开发者ID:Galixte,项目名称:david63-loginredirect,代码行数:34,代码来源:admin_controller.php
示例2: display_settings
/**
* Display the general settings a user can configure for this extension
*
* @return null
* @access public
*/
public function display_settings()
{
// Define the name of the form for use as a form key
add_form_key('ppde_settings');
// Create an array to collect errors that will be output to the user
$errors = array();
$this->submit_settings();
// Set output vars for display in the template
$this->template->assign_vars(array('S_ERROR' => $this->check_config(sizeof($errors)), 'ERROR_MSG' => sizeof($errors) ? implode('<br />', $errors) : '', 'U_ACTION' => $this->u_action, 'PPDE_ACCOUNT_ID' => $this->check_config($this->config['ppde_account_id'], 'string', ''), 'PPDE_DEFAULT_CURRENCY' => $this->container->get('skouat.ppde.controller')->build_currency_select_menu($this->config['ppde_default_currency']), 'PPDE_DEFAULT_VALUE' => $this->check_config($this->config['ppde_default_value'], 'integer', 0), 'PPDE_DROPBOX_VALUE' => $this->check_config($this->config['ppde_dropbox_value'], 'string', '1,2,3,4,5,10,20,25,50,100'), 'S_PPDE_DROPBOX_ENABLE' => $this->check_config($this->config['ppde_dropbox_enable']), 'S_PPDE_ENABLE' => $this->check_config($this->config['ppde_enable']), 'S_PPDE_HEADER_LINK' => $this->check_config($this->config['ppde_header_link']), 'S_PPDE_IPN_AG_ENABLE' => $this->check_config($this->config['ppde_ipn_autogroup_enable']), 'S_PPDE_IPN_AG_GROUP_AS_DEFAULT' => $this->check_config($this->config['ppde_ipn_group_as_default']), 'S_PPDE_IPN_ENABLE' => $this->check_config($this->config['ppde_ipn_enable']), 'S_PPDE_IPN_GROUP_OPTIONS' => group_select_options($this->config['ppde_ipn_group_id']), 'S_PPDE_IPN_LOGGING' => $this->check_config($this->config['ppde_ipn_logging']), 'PPDE_SANDBOX_ADDRESS' => $this->check_config($this->config['ppde_sandbox_address'], 'string', ''), 'S_PPDE_SANDBOX_ENABLE' => $this->check_config($this->config['ppde_sandbox_enable']), 'S_PPDE_SANDBOX_FOUNDER_ENABLE' => $this->check_config($this->config['ppde_sandbox_founder_enable']), 'PPDE_RAISED' => $this->check_config($this->config['ppde_raised'], 'float', 0), 'PPDE_GOAL' => $this->check_config($this->config['ppde_goal'], 'float', 0), 'PPDE_USED' => $this->check_config($this->config['ppde_used'], 'float', 0), 'S_PPDE_STATS_INDEX_ENABLE' => $this->check_config($this->config['ppde_stats_index_enable']), 'S_PPDE_RAISED_ENABLE' => $this->check_config($this->config['ppde_raised_enable']), 'S_PPDE_GOAL_ENABLE' => $this->check_config($this->config['ppde_goal_enable']), 'S_PPDE_USED_ENABLE' => $this->check_config($this->config['ppde_used_enable'])));
}
开发者ID:3D-I,项目名称:ext_paypal_donation,代码行数:16,代码来源:admin_settings_controller.php
示例3: main
function main($id, $mode)
{
global $user, $template, $phpbb_root_path, $phpbb_admin_path, $table_prefix, $db;
global $phpbb_container;
$controller = $phpbb_container->get('alg.adminnotifications.adminnotifications_handler');
$this->tpl_name = 'acp_adminnotifications';
$this->page_title = 'ACP_ADMINNOTIFICATIONS_SETTINGS';
$user->add_lang('acp/permissions');
$form_key = 'acp_adminnotifications';
add_form_key($form_key);
$sql = "SELECT * from " . $table_prefix . "adminnotifications ORDER BY create_time DESC";
$result = $db->sql_query($sql);
if (is_array($result) || is_object($result)) {
foreach ($result as $row) {
$template->assign_block_vars('notysaved', array('NOTY_ID' => $row['noty_id'], 'NOTY_TITLE' => $row['noty_title'], 'NOTY_CONTENT' => $row['noty_content'], 'NOTY_TOOLTIP' => $controller->character_limit($row['noty_content'], 60), 'CREATE_TIME' => $row['create_time'] ? $user->format_date($row['create_time'], "d/m/Y H:i") : 0, 'PARSE_TYPE' => $row['parse_type']));
}
$db->sql_freeresult($result);
}
$exclude_guests = array();
$exclude_ids[] = acp_adminnotifications_module::GUESTS;
$exclude_ids[] = acp_adminnotifications_module::BOTS;
$template->assign_vars(array('S_ADMINNOTIFICATIONS_PAGE' => true, 'S_GROUP_OPTIONS' => group_select_options(false, $exclude_ids, false), 'U_ADMINNOTIFICATIONS_PATH' => './../adminnotifications/'));
}
开发者ID:alg5,项目名称:adminnotifications,代码行数:23,代码来源:acp_adminnotifications_module.php
示例4: main
//.........这里部分代码省略.........
OR b.ban_exclude = 1)';
$sql_ary['LEFT_JOIN'] = array(array('FROM' => array(BANLIST_TABLE => 'b'), 'ON' => 'u.user_id = b.ban_userid'));
}
$sql = $db->sql_build_query('SELECT', $sql_ary);
}
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if (!$row) {
$db->sql_freeresult($result);
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$i = $j = 0;
// Send with BCC, no more than 50 recipients for one mail (to not exceed the limit)
$max_chunk_size = 50;
$email_list = array();
$old_lang = $row['user_lang'];
$old_notify_type = $row['user_notify_type'];
do {
if ($row['user_notify_type'] == NOTIFY_EMAIL && $row['user_email'] || $row['user_notify_type'] == NOTIFY_IM && $row['user_jabber'] || $row['user_notify_type'] == NOTIFY_BOTH && ($row['user_email'] || $row['user_jabber'])) {
if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type) {
$i = 0;
if (sizeof($email_list)) {
$j++;
}
$old_lang = $row['user_lang'];
$old_notify_type = $row['user_notify_type'];
}
$email_list[$j][$i]['lang'] = $row['user_lang'];
$email_list[$j][$i]['method'] = $row['user_notify_type'];
$email_list[$j][$i]['email'] = $row['user_email'];
$email_list[$j][$i]['name'] = $row['username'];
$email_list[$j][$i]['jabber'] = $row['user_jabber'];
$i++;
}
} while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
// Send the messages
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
$messenger = new messenger($use_queue);
$errored = false;
for ($i = 0, $size = sizeof($email_list); $i < $size; $i++) {
$used_lang = $email_list[$i][0]['lang'];
$used_method = $email_list[$i][0]['method'];
for ($j = 0, $list_size = sizeof($email_list[$i]); $j < $list_size; $j++) {
$email_row = $email_list[$i][$j];
$messenger->{sizeof($email_list[$i]) == 1 ? 'to' : 'bcc'}($email_row['email'], $email_row['name']);
$messenger->im($email_row['jabber'], $email_row['name']);
}
$messenger->template('admin_send_email', $used_lang);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->set_mail_priority($priority);
$messenger->assign_vars(array('CONTACT_EMAIL' => $config['board_contact'], 'MESSAGE' => htmlspecialchars_decode($message)));
if (!$messenger->send($used_method)) {
$errored = true;
}
}
unset($email_list);
$messenger->save_queue();
if ($usernames) {
$usernames = explode("\n", $usernames);
add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames)));
} else {
if ($group_id) {
$group_name = get_group_name($group_id);
} else {
// Not great but the logging routine doesn't cope well with localising on the fly
$group_name = $user->lang['ALL_USERS'];
}
add_log('admin', 'LOG_MASS_EMAIL', $group_name);
}
if (!$errored) {
$message = $use_queue ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT'];
trigger_error($message . adm_back_link($this->u_action));
} else {
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=logs&mode=critical') . '">', '</a>');
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
}
}
}
// Exclude bots and guests...
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "\n\t\t\tWHERE group_name IN ('BOTS', 'GUESTS')";
$result = $db->sql_query($sql);
$exclude = array();
while ($row = $db->sql_fetchrow($result)) {
$exclude[] = $row['group_id'];
}
$db->sql_freeresult($result);
$select_list = '<option value="0"' . (!$group_id ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>';
$select_list .= group_select_options($group_id, $exclude);
$s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>';
$s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
$s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
$template->assign_vars(array('S_WARNING' => sizeof($error) ? true : false, 'WARNING_MSG' => sizeof($error) ? implode('<br />', $error) : '', 'U_ACTION' => $this->u_action, 'S_GROUP_OPTIONS' => $select_list, 'USERNAMES' => $usernames, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&form=acp_email&field=usernames'), 'SUBJECT' => $subject, 'MESSAGE' => $message, 'S_PRIORITY_OPTIONS' => $s_priority_options));
}
开发者ID:noprom,项目名称:cryptdb,代码行数:101,代码来源:acp_email.php
示例5: main
//.........这里部分代码省略.........
$type_free = $group_type == GROUP_FREE ? ' checked="checked"' : '';
$type_open = $group_type == GROUP_OPEN ? ' checked="checked"' : '';
$type_closed = $group_type == GROUP_CLOSED ? ' checked="checked"' : '';
$type_hidden = $group_type == GROUP_HIDDEN ? ' checked="checked"' : '';
// Load up stuff for avatars
if ($config['allow_avatar']) {
$avatars_enabled = false;
$selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type']));
foreach ($avatar_drivers as $current_driver) {
$driver = $phpbb_avatar_manager->get_driver($current_driver);
$avatars_enabled = true;
$template->set_filenames(array('avatar' => $driver->get_acp_template_name()));
if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error)) {
$driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
$driver_upper = strtoupper($driver_name);
$template->assign_block_vars('avatar_drivers', array('L_TITLE' => $user->lang($driver_upper . '_TITLE'), 'L_EXPLAIN' => $user->lang($driver_upper . '_EXPLAIN'), 'DRIVER' => $driver_name, 'SELECTED' => $current_driver == $selected_driver, 'OUTPUT' => $template->assign_display('avatar')));
}
}
}
$avatar = phpbb_get_group_avatar($group_row, 'GROUP_AVATAR', true);
if (isset($phpbb_avatar_manager) && !$update) {
// Merge any avatar errors into the primary error array
$error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error));
}
$back_link = $request->variable('back_link', '');
switch ($back_link) {
case 'acp_users_groups':
$u_back = append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=users&mode=groups&u=' . $request->variable('u', 0));
break;
default:
$u_back = $this->u_action;
break;
}
$template->assign_vars(array('S_EDIT' => true, 'S_ADD_GROUP' => $action == 'add' ? true : false, 'S_GROUP_PERM' => $action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth') ? true : false, 'S_INCLUDE_SWATCH' => true, 'S_ERROR' => sizeof($error) ? true : false, 'S_SPECIAL_GROUP' => $group_type == GROUP_SPECIAL ? true : false, 'S_USER_FOUNDER' => $user->data['user_type'] == USER_FOUNDER ? true : false, 'S_AVATARS_ENABLED' => $config['allow_avatar'] && $avatars_enabled, 'ERROR_MSG' => sizeof($error) ? implode('<br />', $error) : '', 'GROUP_NAME' => $group_helper->get_name($group_name), 'GROUP_INTERNAL_NAME' => $group_name, 'GROUP_DESC' => $group_desc_data['text'], 'GROUP_RECEIVE_PM' => isset($group_row['group_receive_pm']) && $group_row['group_receive_pm'] ? ' checked="checked"' : '', 'GROUP_FOUNDER_MANAGE' => isset($group_row['group_founder_manage']) && $group_row['group_founder_manage'] ? ' checked="checked"' : '', 'GROUP_LEGEND' => isset($group_row['group_legend']) && $group_row['group_legend'] ? ' checked="checked"' : '', 'GROUP_TEAMPAGE' => isset($group_row['group_teampage']) && $group_row['group_teampage'] ? ' checked="checked"' : '', 'GROUP_MESSAGE_LIMIT' => isset($group_row['group_message_limit']) ? $group_row['group_message_limit'] : 0, 'GROUP_MAX_RECIPIENTS' => isset($group_row['group_max_recipients']) ? $group_row['group_max_recipients'] : 0, 'GROUP_COLOUR' => isset($group_row['group_colour']) ? $group_row['group_colour'] : '', 'GROUP_SKIP_AUTH' => !empty($group_row['group_skip_auth']) ? ' checked="checked"' : '', 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], 'S_DESC_SMILIES_CHECKED' => $group_desc_data['allow_smilies'], 'S_RANK_OPTIONS' => $rank_options, 'S_GROUP_OPTIONS' => group_select_options(false, false, $user->data['user_type'] == USER_FOUNDER ? false : 0), 'AVATAR' => empty($avatar) ? '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />' : $avatar, 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'], 'AVATAR_WIDTH' => isset($group_row['group_avatar_width']) ? $group_row['group_avatar_width'] : '', 'AVATAR_HEIGHT' => isset($group_row['group_avatar_height']) ? $group_row['group_avatar_height'] : '', 'GROUP_TYPE_FREE' => GROUP_FREE, 'GROUP_TYPE_OPEN' => GROUP_OPEN, 'GROUP_TYPE_CLOSED' => GROUP_CLOSED, 'GROUP_TYPE_HIDDEN' => GROUP_HIDDEN, 'GROUP_TYPE_SPECIAL' => GROUP_SPECIAL, 'GROUP_FREE' => $type_free, 'GROUP_OPEN' => $type_open, 'GROUP_CLOSED' => $type_closed, 'GROUP_HIDDEN' => $type_hidden, 'U_BACK' => $u_back, 'U_ACTION' => "{$this->u_action}&action={$action}&g={$group_id}", 'L_AVATAR_EXPLAIN' => phpbb_avatar_explanation_string()));
/**
* Modify group template data before we display the form
*
* @event core.acp_manage_group_display_form
* @var string action Type of the action: add|edit
* @var bool update Do we display the form only
* or did the user press submit
* @var int group_id The group id
* @var array group_row Array with new group data
* @var string group_name The group name
* @var int group_type The group type
* @var array group_desc_data The group description data
* @var string group_rank The group rank
* @var string rank_options The rank options
* @var array error Array of errors, if you add errors
* ensure to update the template variables
* S_ERROR and ERROR_MSG to display it
* @since 3.1.0-b5
*/
$vars = array('action', 'update', 'group_id', 'group_row', 'group_desc_data', 'group_name', 'group_type', 'group_rank', 'rank_options', 'error');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_group_display_form', compact($vars)));
return;
break;
case 'list':
if (!$group_id) {
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
/* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
$this->page_title = 'GROUP_MEMBERS';
// Grab the leaders - always, on every page...
$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_colour, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
开发者ID:bruninoit,项目名称:phpbb,代码行数:67,代码来源:acp_groups.php
示例6: main
//.........这里部分代码省略.........
if (sizeof($forum_id)) {
$this->check_existence('forum', $forum_id);
continue 2;
}
$template->assign_vars(array('S_SELECT_FORUM' => true, 'S_FORUM_OPTIONS' => make_forum_select(false, false, true, false, false)));
break;
case 'forums':
if (sizeof($forum_id)) {
$this->check_existence('forum', $forum_id);
continue 2;
}
$forum_list = make_forum_select(false, false, true, false, false, false, true);
// Build forum options
$s_forum_options = '';
foreach ($forum_list as $f_id => $f_row) {
$s_forum_options .= '<option value="' . $f_id . '"' . ($f_row['selected'] ? ' selected="selected"' : '') . ($f_row['disabled'] ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
}
// Build subforum options
$s_subforum_options = $this->build_subforum_options($forum_list);
$template->assign_vars(array('S_SELECT_FORUM' => true, 'S_FORUM_OPTIONS' => $s_forum_options, 'S_SUBFORUM_OPTIONS' => $s_subforum_options, 'S_FORUM_ALL' => true, 'S_FORUM_MULTIPLE' => true));
break;
case 'user':
if (sizeof($user_id)) {
$this->check_existence('user', $user_id);
continue 2;
}
$template->assign_vars(array('S_SELECT_USER' => true, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&form=select_victim&field=username&select_single=true')));
break;
case 'group':
if (sizeof($group_id)) {
$this->check_existence('group', $group_id);
continue 2;
}
$template->assign_vars(array('S_SELECT_GROUP' => true, 'S_GROUP_OPTIONS' => group_select_options(false, false, false)));
break;
case 'usergroup':
case 'usergroup_view':
$all_users = isset($_POST['all_users']) ? true : false;
$all_groups = isset($_POST['all_groups']) ? true : false;
if (sizeof($user_id) && !$all_users || sizeof($group_id) && !$all_groups) {
if (sizeof($user_id)) {
$this->check_existence('user', $user_id);
}
if (sizeof($group_id)) {
$this->check_existence('group', $group_id);
}
continue 2;
}
// Now we check the users... because the "all"-selection is different here (all defined users/groups)
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
if ($all_users && sizeof($items['user_ids'])) {
$user_id = $items['user_ids'];
continue 2;
}
if ($all_groups && sizeof($items['group_ids'])) {
$group_id = $items['group_ids'];
continue 2;
}
$template->assign_vars(array('S_SELECT_USERGROUP' => $victim == 'usergroup' ? true : false, 'S_SELECT_USERGROUP_VIEW' => $victim == 'usergroup_view' ? true : false, 'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'], 'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'], 'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], false), 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&form=add_user&field=username&select_single=true')));
break;
}
// The S_ALLOW_SELECT parameter below is a measure to lower memory usage.
// If there are more than 5 forums selected the admin is not able to select all users/groups too.
// We need to see if the number of forums can be increased or need to be decreased.
// Setting permissions screen
$s_hidden_fields = build_hidden_fields(array('user_id' => $user_id, 'group_id' => $group_id, 'forum_id' => $forum_id, 'type' => $permission_type));
开发者ID:phpbb,项目名称:phpbb,代码行数:67,代码来源:acp_permissions.php
示例7: main
//.........这里部分代码省略.........
$email_list[$j][$i]['name'] = $row['username'];
$email_list[$j][$i]['jabber'] = $row['user_jabber'];
$i++;
}
} while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
// Send the messages
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
$messenger = new messenger($use_queue);
$errored = false;
$email_template = 'admin_send_email';
$template_data = array('CONTACT_EMAIL' => phpbb_get_board_contact($config, $phpEx), 'MESSAGE' => htmlspecialchars_decode($message));
$generate_log_entry = true;
/**
* Modify email template data before the emails are sent
*
* @event core.acp_email_send_before
* @var string email_template The template to be used for sending the email
* @var string subject The subject of the email
* @var array template_data Array with template data assigned to email template
* @var bool generate_log_entry If false, no log entry will be created
* @var array usernames Usernames which will be displayed in log entry, if it will be created
* @var int group_id The group this email will be sent to
* @var bool use_queue If true, email queue will be used for sending
* @var int priority Priority of sent emails
* @since 3.1.3-RC1
*/
$vars = array('email_template', 'subject', 'template_data', 'generate_log_entry', 'usernames', 'group_id', 'use_queue', 'priority');
extract($phpbb_dispatcher->trigger_event('core.acp_email_send_before', compact($vars)));
for ($i = 0, $size = sizeof($email_list); $i < $size; $i++) {
$used_lang = $email_list[$i][0]['lang'];
$used_method = $email_list[$i][0]['method'];
for ($j = 0, $list_size = sizeof($email_list[$i]); $j < $list_size; $j++) {
$email_row = $email_list[$i][$j];
$messenger->{sizeof($email_list[$i]) == 1 ? 'to' : 'bcc'}($email_row['email'], $email_row['name']);
$messenger->im($email_row['jabber'], $email_row['name']);
}
$messenger->template($email_template, $used_lang);
$messenger->anti_abuse_headers($config, $user);
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->set_mail_priority($priority);
$messenger->assign_vars($template_data);
if (!$messenger->send($used_method)) {
$errored = true;
}
}
unset($email_list);
$messenger->save_queue();
if ($generate_log_entry) {
if (!empty($usernames)) {
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MASS_EMAIL', false, array(implode(', ', utf8_normalize_nfc($usernames))));
} else {
if ($group_id) {
$group_name = get_group_name($group_id);
} else {
// Not great but the logging routine doesn't cope well with localising on the fly
$group_name = $user->lang['ALL_USERS'];
}
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MASS_EMAIL', false, array($group_name));
}
}
if (!$errored) {
$message = $use_queue ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT'];
trigger_error($message . adm_back_link($this->u_action));
} else {
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=logs&mode=critical') . '">', '</a>');
trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
}
}
}
// Exclude bots and guests...
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "\n\t\t\tWHERE group_name IN ('BOTS', 'GUESTS')";
$result = $db->sql_query($sql);
$exclude = array();
while ($row = $db->sql_fetchrow($result)) {
$exclude[] = $row['group_id'];
}
$db->sql_freeresult($result);
$select_list = '<option value="0"' . (!$group_id ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>';
$select_list .= group_select_options($group_id, $exclude);
$s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>';
$s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
$s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
$template_data = array('S_WARNING' => sizeof($error) ? true : false, 'WARNING_MSG' => sizeof($error) ? implode('<br />', $error) : '', 'U_ACTION' => $this->u_action, 'S_GROUP_OPTIONS' => $select_list, 'USERNAMES' => implode("\n", $usernames), 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&form=acp_email&field=usernames'), 'SUBJECT' => $subject, 'MESSAGE' => $message, 'S_PRIORITY_OPTIONS' => $s_priority_options);
/**
* Modify custom email template data before we display the form
*
* @event core.acp_email_display
* @var array template_data Array with template data assigned to email template
* @var array exclude Array with groups which are excluded from group selection
* @var array usernames Usernames which will be displayed in form
*
* @since 3.1.4-RC1
*/
$vars = array('template_data', 'exclude', 'usernames');
extract($phpbb_dispatcher->trigger_event('core.acp_email_display', compact($vars)));
$template->assign_vars($template_data);
}
开发者ID:hgchen,项目名称:phpbb,代码行数:101,代码来源:acp_email.php
示例8: main
//.........这里部分代码省略.........
}
$db->sql_freeresult($result);
$type_free = $group_type == GROUP_FREE ? ' checked="checked"' : '';
$type_open = $group_type == GROUP_OPEN ? ' checked="checked"' : '';
$type_closed = $group_type == GROUP_CLOSED ? ' checked="checked"' : '';
$type_hidden = $group_type == GROUP_HIDDEN ? ' checked="checked"' : '';
if (isset($group_row['group_avatar']) && $group_row['group_avatar']) {
switch ($group_row['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_row['group_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row['group_avatar_width'] . '" height="' . $group_row['group_avatar_height'] . '" alt="" />';
} else {
$avatar_img = '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
}
$display_gallery = isset($_POST['display_gallery']) ? true : false;
if ($config['allow_avatar_local'] && $display_gallery) {
avatar_gallery($category, $avatar_select, 4);
}
$back_link = request_var('back_link', '');
switch ($back_link) {
case 'acp_users_groups':
$u_back = append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=users&mode=groups&u=' . request_var('u', 0));
break;
default:
$u_back = $this->u_action;
break;
}
$template->assign_vars(array('S_EDIT' => true, 'S_ADD_GROUP' => $action == 'add' ? true : false, 'S_INCLUDE_SWATCH' => true, 'S_CAN_UPLOAD' => $can_upload, 'S_ERROR' => sizeof($error) ? true : false, 'S_SPECIAL_GROUP' => $group_type == GROUP_SPECIAL ? true : false, 'S_DISPLAY_GALLERY' => $config['allow_avatar_local'] && !$display_gallery ? true : false, 'S_IN_GALLERY' => $config['allow_avatar_local'] && $display_gallery ? true : false, 'ERROR_MSG' => sizeof($error) ? implode('<br />', $error) : '', 'GROUP_NAME' => $group_type == GROUP_SPECIAL ? $user->lang['G_' . $group_name] : $group_name, 'GROUP_INTERNAL_NAME' => $group_name, 'GROUP_DESC' => $group_desc_data['text'], 'GROUP_RECEIVE_PM' => isset($group_row['group_receive_pm']) && $group_row['group_receive_pm'] ? ' checked="checked"' : '', 'GROUP_LEGEND' => isset($group_row['group_legend']) && $group_row['group_legend'] ? ' checked="checked"' : '', 'GROUP_MESSAGE_LIMIT' => isset($group_row['group_message_limit']) ? $group_row['group_message_limit'] : 0, 'GROUP_COLOUR' => isset($group_row['group_colour']) ? $group_row['group_colour'] : '', 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], 'S_DESC_SMILIES_CHECKED' => $group_desc_data['allow_smilies'], 'S_RANK_OPTIONS' => $rank_options, 'S_GROUP_OPTIONS' => group_select_options(0), 'AVATAR_IMAGE' => $avatar_img, 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'], 'GROUP_AVATAR_WIDTH' => isset($group_row['group_avatar_width']) ? $group_row['group_avatar_width'] : '', 'GROUP_AVATAR_HEIGHT' => isset($group_row['group_avatar_height']) ? $group_row['group_avatar_height'] : '', 'GROUP_TYPE_FREE' => GROUP_FREE, 'GROUP_TYPE_OPEN' => GROUP_OPEN, 'GROUP_TYPE_CLOSED' => GROUP_CLOSED, 'GROUP_TYPE_HIDDEN' => GROUP_HIDDEN, 'GROUP_TYPE_SPECIAL' => GROUP_SPECIAL, 'GROUP_FREE' => $type_free, 'GROUP_OPEN' => $type_open, 'GROUP_CLOSED' => $type_closed, 'GROUP_HIDDEN' => $type_hidden, 'U_BACK' => $u_back, 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.{$phpEx}", 'form=settings&name=group_colour'), 'UA_SWATCH' => append_sid("{$phpbb_admin_path}swatch.{$phpEx}", 'form=settings&name=group_colour', false), 'U_ACTION' => "{$this->u_action}&action={$action}&g={$group_id}", 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024))));
return;
break;
case 'list':
if (!$group_id) {
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
}
$this->page_title = 'GROUP_MEMBERS';
// Total number of group leaders
$sql = 'SELECT COUNT(user_id) AS total_leaders
FROM ' . USER_GROUP_TABLE . " \n\t\t\t\t\tWHERE group_id = {$group_id} \n\t\t\t\t\t\tAND group_leader = 1";
$result = $db->sql_query($sql);
$total_leaders = (int) $db->sql_fetchfield('total_leaders');
$db->sql_freeresult($result);
// Total number of group members (non-leaders)
$sql = 'SELECT COUNT(user_id) AS total_members
FROM ' . USER_GROUP_TABLE . " \n\t\t\t\t\tWHERE group_id = {$group_id} \n\t\t\t\t\t\tAND group_leader <> 1";
$result = $db->sql_query($sql);
$total_members = (int) $db->sql_fetchfield('total_members');
$db->sql_freeresult($result);
// Grab the members
$sql = 'SELECT u.user_id, u.username, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug \n\t\t\t\t\tWHERE ug.group_id = {$group_id} \n\t\t\t\t\t\tAND u.user_id = ug.user_id \n\t\t\t\t\tORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username";
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$leader = $member = 0;
$group_data = array('leader' => array(), 'member' => array());
while ($row = $db->sql_fetchrow($result)) {
$type = $row['group_leader'] ? 'leader' : 'member';
$group_data[$type][${$type}]['user_id'] = $row['user_id'];
$group_data[$type][${$type}]['group_id'] = $row['group_id'];
$group_data[$type][${$type}]['username'] = $row['username'];
$group_data[$type][${$type}]['user_regdate'] = $row['user_regdate'];
$group_data[$type][${$type}]['user_posts'] = $row['user_posts'];
开发者ID:yunsite,项目名称:gloryroad,代码行数:67,代码来源:acp_groups.php
示例9: main
//.........这里部分代码省略.........
$usernames = implode(', ', preg_replace('#^[\\s]*?(.*?)[\\s]*?$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", explode("\n", $usernames)));
$sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang
FROM ' . USERS_TABLE . " \n\t\t\t\t\t\tWHERE username IN ({$usernames})\n\t\t\t\t\t\t\tAND user_allow_massemail = 1\n\t\t\t\t\t\tORDER BY user_lang, user_notify_type";
// , SUBSTRING(user_email FROM INSTR(user_email, '@'))
} else {
if ($group_id) {
$sql = 'SELECT u.user_email, u.username, u.user_lang, u.user_jabber, u.user_notify_type
FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug \n\t\t\t\t\t\t\tWHERE ug.group_id = {$group_id} \n\t\t\t\t\t\t\t\tAND ug.user_pending = 0\n\t\t\t\t\t\t\t\tAND u.user_id = ug.user_id \n\t\t\t\t\t\t\t\tAND u.user_allow_massemail = 1\n\t\t\t\t\t\t\tORDER BY u.user_lang, u.user_notify_type";
} else {
$sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang
FROM ' . USERS_TABLE . '
WHERE user_allow_massemail = 1
ORDER BY user_lang, user_notify_type';
}
}
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$row) {
trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
}
$i = $j = 0;
// Send with BCC, no more than 50 recipients for one mail (to not exceed the limit)
$max_chunk_size = 50;
$email_list = array();
$old_lang = $row['user_lang'];
$old_notify_type = $row['user_notify_type'];
do {
if ($row['user_notify_type'] == NOTIFY_EMAIL && $row['user_email'] || $row['user_notify_type'] == NOTIFY_IM && $row['user_jabber'] || $row['user_notify_type'] == NOTIFY_BOTH && $row['user_email'] && $row['user_jabber']) {
if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type) {
$i = 0;
$j++;
$old_lang = $row['user_lang'];
$old_notify_type = $row['user_notify_type'];
}
$email_list[$j][$i]['lang'] = $row['user_lang'];
$email_list[$j][$i]['method'] = $row['user_notify_type'];
$email_list[$j][$i]['email'] = $row['user_email'];
$email_list[$j][$i]['name'] = $row['username'];
$email_list[$j][$i]['jabber'] = $row['user_jabber'];
$i++;
}
} while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
// Send the messages
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
include_once $phpbb_root_path . 'includes/functions_user.' . $phpEx;
$messenger = new messenger($use_queue);
$errored = false;
for ($i = 0, $size = sizeof($email_list); $i < $size; $i++) {
$used_lang = $email_list[$i][0]['lang'];
$used_method = $email_list[$i][0]['method'];
for ($j = 0, $list_size = sizeof($email_list[$i]); $j < $list_size; $j++) {
$email_row = $email_list[$i][$j];
$messenger->{sizeof($email_list[$i]) == 1 ? 'to' : 'bcc'}($email_row['email'], $email_row['name']);
$messenger->im($email_row['jabber'], $email_row['name']);
}
$messenger->template('admin_send_email', $used_lang);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
$messenger->subject(html_entity_decode($subject));
$messenger->replyto($config['board_email']);
$messenger->set_mail_priority($priority);
$messenger->assign_vars(array('SITENAME' => $config['sitename'], 'CONTACT_EMAIL' => $config['board_contact'], 'MESSAGE' => html_entity_decode($message)));
if (!$messenger->send($used_method)) {
$errored = true;
}
}
unset($email_list);
$messenger->save_queue();
if ($group_id) {
$group_name = get_group_name($group_id);
} else {
// Not great but the logging routine doesn't cope well with localising on the fly
$group_name = $user->lang['ALL_USERS'];
}
add_log('admin', 'LOG_MASS_EMAIL', $group_name);
if (!$errored) {
$message = $use_queue ? $user->lang['EMAIL_SENT_QUEUE'] : $user->lang['EMAIL_SENT'];
} else {
$message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.{$phpEx}", 'i=logs&mode=critical') . '">', '</a>');
}
trigger_error($message . adm_back_link($this->u_action));
}
}
// Exclude bots...
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "\n\t\t\tWHERE group_name = 'BOTS'";
$result = $db->sql_query($sql);
$bot_group_id = (int) $db->sql_fetchfield('group_id');
$db->sql_freeresult($result);
$select_list = '<option value="0"' . (!$group_id ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>';
$select_list .= group_select_options($group_id, array($bot_group_id));
$s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>';
$s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
$s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
$template->assign_vars(array('S_WARNING' => sizeof($error) ? true : false, 'WARNING_MSG' => sizeof($error) ? implode('<br />', $error) : '', 'U_ACTION' => $this->u_action, 'S_GROUP_OPTIONS' => $select_list, 'USERNAMES' => $usernames, 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=searchuser&form=acp_email&field=usernames'), 'SUBJECT' => $subject, 'MESSAGE' => $message, 'S_PRIORITY_OPTIONS' => $s_priority_options));
}
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:acp_email.php
示例10: main
//.........这里部分代码省略.........
$group_type = $group_row['group_type'];
$group_rank = $group_row['group_rank'];
}
}
$sql = 'SELECT *
FROM ' . RANKS_TABLE . '
WHERE rank_special = 1
ORDER BY rank_title';
$result = $db->sql_query($sql);
$rank_options = '<option value="0"' . (!$group_rank ? ' selected="selected"' : '') . '>' . $user->lang['USER_DEFAULT'] . '</option>';
while ($row = $db->sql_fetchrow($result)) {
$selected = $group_rank && $row['rank_id']
|
请发表评论