Changeset 1037
- Timestamp:
- 08/09/07 12:53:32 (1 year ago)
- Files:
-
- trunk/wp-admin/wpmu-blogs.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/wpmu-blogs.php
r1031 r1037 17 17 $options_table_name = "$wpmuBaseTablePrefix{$id}_options"; 18 18 $options = $wpdb->get_results( "SELECT * FROM {$options_table_name} WHERE option_name NOT LIKE 'rss%' AND option_name NOT LIKE '%user_roles'", ARRAY_A ); 19 $details = $wpdb->get_row( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = '{$_GET[ 'id' ]}'", ARRAY_A ); 19 $details = $wpdb->get_row( "SELECT * FROM {$wpdb->blogs} WHERE blog_id = '{$id}'", ARRAY_A ); 20 $editblog_roles = get_blog_option( $id, "$wpmuBaseTablePrefix{$id}_user_roles" ); 20 21 21 22 print "<h2>" . __('Edit Blog') . "</h2>"; … … 24 25 <form name="form1" method="post" action="wpmu-edit.php?action=updateblog"> 25 26 <?php wp_nonce_field( "editblog" ); ?> 26 <input type="hidden" name="id" value="<?php echo $ _GET[ 'id' ]?>" />27 <input type="hidden" name="id" value="<?php echo $id ?>" /> 27 28 <table><td valign='top'> 28 29 <div class="wrap"> … … 79 80 </td></tr> 80 81 <?php 81 while( list( $key, $val ) = each( $options ) ) { 82 $disabled = ''; 83 if ( is_serialized($val[ 'option_value' ]) ) { 84 if ( is_serialized_string($val[ 'option_value' ]) ) { 85 $val[ 'option_value' ] = wp_specialchars(maybe_unserialize($val[ 'option_value' ]), 'single'); 86 } else { 87 $val[ 'option_value' ] = "SERIALIZED DATA"; 88 $disabled = ' disabled="disabled"'; 89 } 90 } 82 $editblog_default_role = 'subscriber'; 83 while( list( $key, $val ) = each( $options ) ) { 84 if( $val[ 'option_name' ] == 'default_role' ) 85 $editblog_default_role = $val[ 'option_value' ]; 86 $disabled = ''; 87 if ( is_serialized($val[ 'option_value' ]) ) { 88 if ( is_serialized_string($val[ 'option_value' ]) ) { 89 $val[ 'option_value' ] = wp_specialchars(maybe_unserialize($val[ 'option_value' ]), 'single'); 90 } else { 91 $val[ 'option_value' ] = "SERIALIZED DATA"; 92 $disabled = ' disabled="disabled"'; 93 } 94 } 91 95 if ( stristr($val[ 'option_value' ], "\r") or stristr($val[ 'option_value' ], "\n") or stristr($val[ 'option_value' ], "\r\n") ) { 92 96 ?> … … 144 148 print "</table></div>"; 145 149 } 146 $blogusers = get_users_of_blog( $ _GET[ 'id' ]);150 $blogusers = get_users_of_blog( $id ); 147 151 print '<div class="wrap"><h3>' . __('Blog Users') . '</h3>'; 148 152 if( is_array( $blogusers ) ) { … … 161 165 ?> 162 166 <td><select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php 163 foreach( $wp_roles->role_names as $role => $name){167 foreach( $editblog_roles as $role => $role_assoc ){ 164 168 $selected = ''; 165 169 if( $role == $existing_role ) 166 170 $selected = 'selected="selected"'; 167 echo "<option {$selected} value=\"{$role}\">{$ name}</option>";171 echo "<option {$selected} value=\"{$role}\">{$role_assoc['name']}</option>"; 168 172 } 169 173 ?></select></td><td><input type='text' name='user_password[<?php echo $val->user_id ?>]'></td><?php … … 185 189 <th scope="row"><?php _e('Role:') ?></th> 186 190 <td><select name="new_role" id="new_role"><?php 187 foreach($wp_roles->role_names as $role => $name) { 191 reset( $editblog_roles ); 192 foreach( $editblog_roles as $role => $role_assoc ){ 188 193 $selected = ''; 189 if( $role == 'subscriber')194 if( $role == $editblog_default_role ) 190 195 $selected = 'selected="selected"'; 191 echo "<option {$selected} value=\"{$role}\">{$ name}</option>";196 echo "<option {$selected} value=\"{$role}\">{$role_assoc['name']}</option>"; 192 197 } 193 198 ?></select></td>
