Changeset 702 for trunk/forum/includes/ucp/ucp_groups.php
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/includes/ucp/ucp_groups.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_groups.php 9067 2008-11-21 13:21:53Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 42 42 { 43 43 case 'membership': 44 44 45 45 $this->page_title = 'UCP_USERGROUPS_MEMBER'; 46 46 … … 341 341 ); 342 342 343 $group_id_ary[] = $row['group_id'];343 $group_id_ary[] = (int) $row['group_id']; 344 344 } 345 345 $db->sql_freeresult($result); … … 415 415 $action = (isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''); 416 416 $group_id = request_var('g', 0); 417 417 418 418 include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 419 419 … … 439 439 trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING); 440 440 } 441 441 442 442 $group_name = $group_row['group_name']; 443 443 $group_type = $group_row['group_type']; 444 444 445 445 $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />'; 446 446 … … 451 451 'GROUP_DESC_DISP' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']), 452 452 'GROUP_TYPE' => $group_row['group_type'], 453 453 454 454 'AVATAR' => $avatar_img, 455 455 'AVATAR_IMAGE' => $avatar_img, … … 605 605 // group. This prevents existing group members being updated if no changes 606 606 // were made. 607 607 608 608 $group_attributes = array(); 609 $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients'); 610 foreach ($test_variables as $test) 611 { 612 if ($action == 'add' || (isset($submit_ary[$test]) && $group_row['group_' . $test] != $submit_ary[$test])) 609 $test_variables = array( 610 'rank' => 'int', 611 'colour' => 'string', 612 'avatar' => 'string', 613 'avatar_type' => 'int', 614 'avatar_width' => 'int', 615 'avatar_height' => 'int', 616 'receive_pm' => 'int', 617 'legend' => 'int', 618 'message_limit' => 'int', 619 'max_recipients'=> 'int', 620 ); 621 622 foreach ($test_variables as $test => $type) 623 { 624 if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) 613 625 { 626 settype($submit_ary[$test], $type); 614 627 $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; 615 628 } … … 676 689 $display_gallery = (isset($_POST['display_gallery'])) ? true : false; 677 690 678 if ($config['allow_avatar _local'] && $display_gallery)691 if ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery) 679 692 { 680 693 avatar_gallery($category, $avatar_select, 4); 681 694 } 682 683 $avatars_enabled = ($c an_upload || ($config['allow_avatar_local'] || $config['allow_avatar_remote'])) ? true : false;695 696 $avatars_enabled = ($config['allow_avatar'] && (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false; 684 697 685 698 $template->assign_vars(array( 686 699 'S_EDIT' => true, 687 700 'S_INCLUDE_SWATCH' => true, 688 'S_CAN_UPLOAD' => $can_upload, 689 'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '', 701 'S_FORM_ENCTYPE' => ($config['allow_avatar'] && $can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '', 690 702 'S_ERROR' => (sizeof($error)) ? true : false, 691 703 'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false, 692 704 'S_AVATARS_ENABLED' => $avatars_enabled, 693 'S_DISPLAY_GALLERY' => ($config['allow_avatar _local'] && !$display_gallery) ? true : false,705 'S_DISPLAY_GALLERY' => ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false, 694 706 'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false, 707 708 'S_UPLOAD_AVATAR_FILE' => ($config['allow_avatar'] && $config['allow_avatar_upload'] && $can_upload) ? true : false, 709 'S_UPLOAD_AVATAR_URL' => ($config['allow_avatar'] && $config['allow_avatar_remote_upload'] && $can_upload) ? true : false, 710 'S_LINK_AVATAR' => ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false, 695 711 696 712 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', … … 698 714 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, 699 715 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0, 700 716 701 717 'GROUP_DESC' => $group_desc_data['text'], 702 718 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], … … 840 856 841 857 'U_ACTION' => $this->u_action . "&g=$group_id", 858 'S_UCP_ACTION' => $this->u_action . "&g=$group_id", 842 859 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames'), 843 860 )); … … 897 914 { 898 915 $start = 0; 899 916 900 917 do 901 918 { … … 949 966 } 950 967 968 // redirect to last screen 969 redirect($this->u_action . '&action=list&g=' . $group_id); 970 951 971 break; 952 972 … … 995 1015 } 996 1016 1017 // redirect to last screen 1018 redirect($this->u_action . '&action=list&g=' . $group_id); 1019 997 1020 break; 998 1021 … … 1028 1051 1029 1052 $default = request_var('default', 0); 1030 1053 1031 1054 if (confirm_box(true)) 1032 1055 {
Note:
See TracChangeset
for help on using the changeset viewer.