Changeset 5908
- Timestamp:
- 08/11/2015 08:17:53 PM (10 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/converters/e107v1.php
r5829 r5908 567 567 $field = preg_replace( '/(\d+?)+\.[\S\s]+/', '$1', $field ); 568 568 569 if ( ! isset( $this->map_userid[ $field] ) ) {569 if ( ! isset( $this->map_userid[ $field ] ) ) { 570 570 if ( ! empty( $this->sync_table ) ) { 571 571 $row = $this->wpdb->get_row( $this->wpdb->prepare( 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_user_id" AND meta_value = "%s" LIMIT 1', $field ) ); … … 575 575 576 576 if ( !is_null( $row ) ) { 577 $this->map_userid[ $field] = $row->value_id;577 $this->map_userid[ $field ] = $row->value_id; 578 578 } else { 579 579 if ( ! empty( $_POST['_bbp_converter_convert_users'] ) && ( $_POST['_bbp_converter_convert_users'] == 1 ) ) { 580 $this->map_userid[ $field] = 0;580 $this->map_userid[ $field ] = 0; 581 581 } else { 582 $this->map_userid[ $field] = $field;582 $this->map_userid[ $field ] = $field; 583 583 } 584 584 } 585 585 } 586 return $this->map_userid[ $field];586 return $this->map_userid[ $field ]; 587 587 } 588 588 -
trunk/src/includes/admin/converters/phpBB.php
r5798 r5908 796 796 797 797 do { 798 $value = ord( $input[ $i++] );799 $output .= $itoa64[ $value & 0x3f];798 $value = ord( $input[ $i++ ] ); 799 $output .= $itoa64[ $value & 0x3f ]; 800 800 801 801 if ($i < $count) { 802 $value |= ord( $input[ $i] ) << 8;802 $value |= ord( $input[ $i ] ) << 8; 803 803 } 804 804 … … 810 810 811 811 if ( $i < $count ) { 812 $value |= ord( $input[ $i] ) << 16;812 $value |= ord( $input[ $i ] ) << 16; 813 813 } 814 814 -
trunk/src/includes/admin/forums.php
r5868 r5908 803 803 804 804 // Messages array 805 $messages[ $this->post_type] = array(805 $messages[ $this->post_type ] = array( 806 806 0 => '', // Left empty on purpose 807 807 -
trunk/src/includes/admin/replies.php
r5850 r5908 920 920 921 921 // Messages array 922 $messages[ $this->post_type] = array(922 $messages[ $this->post_type ] = array( 923 923 0 => '', // Left empty on purpose 924 924 -
trunk/src/includes/admin/settings.php
r5884 r5908 442 442 443 443 $fields = bbp_admin_get_settings_fields(); 444 $retval = isset( $fields[$section_id] ) ? $fields[$section_id] : false; 444 $retval = isset( $fields[ $section_id ] ) 445 ? $fields[ $section_id ] 446 : false; 445 447 446 448 return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id ); … … 1630 1632 */ 1631 1633 function bbp_maybe_admin_setting_disabled( $option_key = '' ) { 1632 disabled( isset( bbpress()->options[ $option_key] ) );1634 disabled( isset( bbpress()->options[ $option_key ] ) ); 1633 1635 } 1634 1636 … … 1758 1760 $page_base = $page . '_base'; 1759 1761 $page_title = sprintf( __( '%s page', 'bbpress' ), $page_data->title ); 1760 $core_slugs[$page_base] = array( 'name' => $page_title, 'default' => $page_data->slug, 'context' => 'BuddyPress' ); 1762 $core_slugs[ $page_base ] = array( 1763 'name' => $page_title, 1764 'default' => $page_data->slug, 1765 'context' => 'BuddyPress' 1766 ); 1761 1767 } 1762 1768 } -
trunk/src/includes/admin/tools.php
r5899 r5908 1865 1865 1866 1866 // Get sticky topic ID's, or use empty string 1867 $stickers = empty( $forum_stickies[ $forum_id] ) ? '' : array_values( $forum_stickies[ $forum_id ] );1867 $stickers = empty( $forum_stickies[ $forum_id ] ) ? '' : array_values( $forum_stickies[ $forum_id ] ); 1868 1868 1869 1869 // Update the forum's sticky topics meta -
trunk/src/includes/admin/topics.php
r5886 r5908 1073 1073 1074 1074 // Messages array 1075 $messages[ $this->post_type] = array(1075 $messages[ $this->post_type ] = array( 1076 1076 0 => '', // Left empty on purpose 1077 1077 -
trunk/src/includes/admin/users.php
r5770 r5908 255 255 if ( ! empty( $user_role ) ) { 256 256 $roles = bbp_get_dynamic_roles(); 257 $retval = translate_user_role( $roles[ $user_role]['name'] );257 $retval = translate_user_role( $roles[ $user_role ]['name'] ); 258 258 } 259 259 } -
trunk/src/includes/common/classes.php
r5829 r5908 374 374 // If we're at the max depth and the current element still has children, loop over those 375 375 // and display them at this level to prevent them being orphaned to the end of the list. 376 if ( ( $max_depth <= (int) $depth + 1 ) && isset( $children_elements[ $id] ) ) {377 foreach ( $children_elements[ $id] as $child ) {376 if ( ( $max_depth <= (int) $depth + 1 ) && isset( $children_elements[ $id ] ) ) { 377 foreach ( $children_elements[ $id ] as $child ) { 378 378 $this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output ); 379 379 } 380 unset( $children_elements[ $id] );380 unset( $children_elements[ $id ] ); 381 381 } 382 382 } -
trunk/src/includes/common/formatting.php
r5770 r5908 171 171 172 172 // Which walker to use based on the tag and arguments 173 if ( isset( $empty[ $tag] ) ) {173 if ( isset( $empty[ $tag ] ) ) { 174 174 array_walk( $content, 'bbp_encode_empty_callback', $preg ); 175 175 } else { -
trunk/src/includes/common/functions.php
r5907 r5908 152 152 // Step one: the first chunk 153 153 for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) { 154 $seconds = $chunks[ $i][0];154 $seconds = $chunks[ $i ][0]; 155 155 156 156 // Finding the biggest chunk (if the chunk fits, break) … … 162 162 163 163 // If $i iterates all the way to $j, then the event happened 0 seconds ago 164 if ( ! isset( $chunks[ $i] ) ) {164 if ( ! isset( $chunks[ $i ] ) ) { 165 165 $output = $right_now_text; 166 166 … … 168 168 169 169 // Set output var 170 $output = ( 1 == $count ) ? '1 '. $chunks[ $i][1] : $count . ' ' . $chunks[$i][2];170 $output = ( 1 == $count ) ? '1 '. $chunks[ $i ][1] : $count . ' ' . $chunks[ $i ][2]; 171 171 172 172 // Step two: the second chunk 173 173 if ( $i + 2 < $j ) { 174 $seconds2 = $chunks[ $i + 1][0];175 $name2 = $chunks[ $i + 1][1];174 $seconds2 = $chunks[ $i + 1 ][0]; 175 $name2 = $chunks[ $i + 1 ][1]; 176 176 $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ); 177 177 178 178 // Add to output var 179 179 if ( 0 != $count2 ) { 180 $output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[ $i + 1][2];180 $output .= ( 1 == $count2 ) ? _x( ',', 'Separator in time since', 'bbpress' ) . ' 1 '. $name2 : _x( ',', 'Separator in time since', 'bbpress' ) . ' ' . $count2 . ' ' . $chunks[ $i + 1 ][2]; 181 181 } 182 182 } … … 1882 1882 // Setup matched variables to select 1883 1883 foreach ( $query_vars as $key => $value ) { 1884 if ( isset( $select_query_vars[ $key] ) ) {1885 $select_query_vars[ $key] = $value;1884 if ( isset( $select_query_vars[ $key ] ) ) { 1885 $select_query_vars[ $key ] = $value; 1886 1886 } 1887 1887 } -
trunk/src/includes/common/template.php
r5868 r5908 1309 1309 1310 1310 // Set request varaible 1311 $pre_ret_val = $_REQUEST[ $request];1311 $pre_ret_val = $_REQUEST[ $request ]; 1312 1312 1313 1313 // Treat different kinds of fields in different ways … … 1890 1890 foreach ( $plugins as $key => $value ) { 1891 1891 if ( 'fullscreen' === $value ) { 1892 unset( $plugins[ $key] );1892 unset( $plugins[ $key ] ); 1893 1893 break; 1894 1894 } -
trunk/src/includes/core/capabilities.php
r5827 r5908 349 349 function _bbp_reinit_dynamic_roles( $roles = array() ) { 350 350 foreach ( bbp_get_dynamic_roles() as $role_id => $details ) { 351 $roles[ $role_id] = $details;351 $roles[ $role_id ] = $details; 352 352 } 353 353 return $roles; -
trunk/src/includes/core/functions.php
r5829 r5908 200 200 } 201 201 202 $bbp->views[ $view] = array(202 $bbp->views[ $view ] = array( 203 203 'title' => $title, 204 204 'query' => $query_args, … … 206 206 ); 207 207 208 return $bbp->views[ $view];208 return $bbp->views[ $view ]; 209 209 } 210 210 … … 272 272 function bbp_get_view_query_args( $view ) { 273 273 $view = bbp_get_view_id( $view ); 274 $retval = ! empty( $view ) ? bbpress()->views[$view]['query'] : false; 274 $retval = ! empty( $view ) 275 ? bbpress()->views[ $view ]['query'] 276 : false; 275 277 276 278 return apply_filters( 'bbp_get_view_query_args', $retval, $view ); -
trunk/src/includes/core/template-functions.php
r5829 r5908 322 322 // Sort 323 323 if ( ! isset( $merged_filters[ $tag ] ) ) { 324 ksort( $wp_filter[ $tag] );324 ksort( $wp_filter[ $tag ] ); 325 325 $merged_filters[ $tag ] = true; 326 326 } … … 331 331 // Loop through 'bbp_template_stack' filters, and call callback functions 332 332 do { 333 foreach ( (array) current( $wp_filter[ $tag] ) as $the_ ) {333 foreach ( (array) current( $wp_filter[ $tag ] ) as $the_ ) { 334 334 if ( ! is_null( $the_['function'] ) ) { 335 335 $args[1] = $stack; … … 337 337 } 338 338 } 339 } while ( next( $wp_filter[ $tag] ) !== false );339 } while ( next( $wp_filter[ $tag ] ) !== false ); 340 340 341 341 // Remove 'bbp_template_stack' from the current filter array -
trunk/src/includes/core/theme-compat.php
r5829 r5908 69 69 */ 70 70 public function __set( $property, $value ) { 71 return $this->_data[ $property] = $value;71 return $this->_data[ $property ] = $value; 72 72 } 73 73 … … 81 81 */ 82 82 public function __get( $property ) { 83 return array_key_exists( $property, $this->_data ) ? $this->_data[$property] : ''; 83 return array_key_exists( $property, $this->_data ) 84 ? $this->_data[ $property ] 85 : ''; 84 86 } 85 87 } … … 97 99 98 100 // Make sure theme package is available, set to default if not 99 if ( ! isset( $bbp->theme_compat->packages[ $theme] ) || ! is_a( $bbp->theme_compat->packages[$theme], 'BBP_Theme_Compat' ) ) {101 if ( ! isset( $bbp->theme_compat->packages[ $theme ] ) || ! is_a( $bbp->theme_compat->packages[ $theme ], 'BBP_Theme_Compat' ) ) { 100 102 $theme = 'default'; 101 103 } … … 103 105 // Try to set the active theme compat theme. If it's not in the registered 104 106 // packages array, it doesn't exist, so do nothing with it. 105 if ( isset( $bbp->theme_compat->packages[ $theme] ) ) {106 $bbp->theme_compat->theme = $bbp->theme_compat->packages[ $theme];107 if ( isset( $bbp->theme_compat->packages[ $theme ] ) ) { 108 $bbp->theme_compat->theme = $bbp->theme_compat->packages[ $theme ]; 107 109 } 108 110 } … … 289 291 290 292 // Only override if the flag is set and not previously registered 291 if ( empty( $bbp->theme_compat->packages[ $theme->id] ) || ( true === $override ) ) {292 $bbp->theme_compat->packages[ $theme->id] = $theme;293 if ( empty( $bbp->theme_compat->packages[ $theme->id ] ) || ( true === $override ) ) { 294 $bbp->theme_compat->packages[ $theme->id ] = $theme; 293 295 } 294 296 } … … 874 876 875 877 // Filters exist 876 if ( isset( $wp_filter[ $tag] ) ) {878 if ( isset( $wp_filter[ $tag ] ) ) { 877 879 878 880 // Filters exist in this priority 879 if ( ! empty( $priority ) && isset( $wp_filter[ $tag][$priority] ) ) {881 if ( ! empty( $priority ) && isset( $wp_filter[ $tag ][ $priority ] ) ) { 880 882 881 883 // Store filters in a backup 882 $bbp->filters->wp_filter[ $tag][$priority] = $wp_filter[$tag][$priority];884 $bbp->filters->wp_filter[ $tag ][ $priority ] = $wp_filter[ $tag ][ $priority ]; 883 885 884 886 // Unset the filters 885 unset( $wp_filter[ $tag][$priority] );887 unset( $wp_filter[ $tag ][ $priority ] ); 886 888 887 889 // Priority is empty … … 889 891 890 892 // Store filters in a backup 891 $bbp->filters->wp_filter[ $tag] = $wp_filter[$tag];893 $bbp->filters->wp_filter[ $tag ] = $wp_filter[ $tag ]; 892 894 893 895 // Unset the filters 894 unset( $wp_filter[ $tag] );896 unset( $wp_filter[ $tag ] ); 895 897 } 896 898 } 897 899 898 900 // Check merged filters 899 if ( isset( $merged_filters[ $tag] ) ) {901 if ( isset( $merged_filters[ $tag ] ) ) { 900 902 901 903 // Store filters in a backup 902 $bbp->filters->merged_filters[ $tag] = $merged_filters[$tag];904 $bbp->filters->merged_filters[ $tag ] = $merged_filters[ $tag ]; 903 905 904 906 // Unset the filters 905 unset( $merged_filters[ $tag] );907 unset( $merged_filters[ $tag ] ); 906 908 } 907 909 … … 926 928 927 929 // Filters exist 928 if ( isset( $bbp->filters->wp_filter[ $tag] ) ) {930 if ( isset( $bbp->filters->wp_filter[ $tag ] ) ) { 929 931 930 932 // Filters exist in this priority 931 if ( ! empty( $priority ) && isset( $bbp->filters->wp_filter[ $tag][$priority] ) ) {933 if ( ! empty( $priority ) && isset( $bbp->filters->wp_filter[ $tag ][ $priority ] ) ) { 932 934 933 935 // Store filters in a backup 934 $wp_filter[ $tag][$priority] = $bbp->filters->wp_filter[$tag][$priority];936 $wp_filter[ $tag ][ $priority ] = $bbp->filters->wp_filter[ $tag ][ $priority ]; 935 937 936 938 // Unset the filters 937 unset( $bbp->filters->wp_filter[ $tag][$priority] );939 unset( $bbp->filters->wp_filter[ $tag ][ $priority ] ); 938 940 939 941 // Priority is empty … … 941 943 942 944 // Store filters in a backup 943 $wp_filter[ $tag] = $bbp->filters->wp_filter[$tag];945 $wp_filter[ $tag ] = $bbp->filters->wp_filter[ $tag ]; 944 946 945 947 // Unset the filters 946 unset( $bbp->filters->wp_filter[ $tag] );948 unset( $bbp->filters->wp_filter[ $tag ] ); 947 949 } 948 950 } 949 951 950 952 // Check merged filters 951 if ( isset( $bbp->filters->merged_filters[ $tag] ) ) {953 if ( isset( $bbp->filters->merged_filters[ $tag ] ) ) { 952 954 953 955 // Store filters in a backup 954 $merged_filters[ $tag] = $bbp->filters->merged_filters[$tag];956 $merged_filters[ $tag ] = $bbp->filters->merged_filters[ $tag ]; 955 957 956 958 // Unset the filters 957 unset( $bbp->filters->merged_filters[ $tag] );959 unset( $bbp->filters->merged_filters[ $tag ] ); 958 960 } 959 961 -
trunk/src/includes/extend/akismet.php
r5842 r5908 399 399 // Key should not be ignored 400 400 if ( ! in_array( $key, $ignore ) && is_string( $value ) ) { 401 $post_data[ $key] = $value;401 $post_data[ $key ] = $value; 402 402 403 403 // Key should be ignored 404 404 } else { 405 $post_data[ $key] = '';405 $post_data[ $key ] = ''; 406 406 } 407 407 } -
trunk/src/includes/extend/buddypress/groups.php
r5906 r5908 371 371 if ( empty( $forum ) ) { 372 372 $this->remove_forum( array( 'forum_id' => $forum_id ) ); 373 unset( $forum_ids[ $forum_id] );373 unset( $forum_ids[ $forum_id ] ); 374 374 } 375 375 } 376 376 377 377 // No support for multiple forums yet 378 $forum_id = (int) ( is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids ); 378 $forum_id = (int) ( is_array( $forum_ids ) 379 ? $forum_ids[0] 380 : $forum_ids ); 379 381 } 380 382 -
trunk/src/includes/forums/functions.php
r5858 r5908 1984 1984 $key = array_search( bbp_get_private_status_id(), $post_stati ); 1985 1985 if ( ! empty( $key ) ) { 1986 unset( $post_stati[ $key] );1986 unset( $post_stati[ $key ] ); 1987 1987 } 1988 1988 … … 1998 1998 $key = array_search( bbp_get_hidden_status_id(), $post_stati ); 1999 1999 if ( ! empty( $key ) ) { 2000 unset( $post_stati[ $key] );2000 unset( $post_stati[ $key ] ); 2001 2001 } 2002 2002 -
trunk/src/includes/replies/template.php
r5894 r5908 799 799 foreach ( (array) $revisions as $revision ) { 800 800 801 if ( empty( $revision_log[ $revision->ID] ) ) {801 if ( empty( $revision_log[ $revision->ID ] ) ) { 802 802 $author_id = $revision->post_author; 803 803 $reason = ''; 804 804 } else { 805 $author_id = $revision_log[ $revision->ID]['author'];806 $reason = $revision_log[ $revision->ID]['reason'];805 $author_id = $revision_log[ $revision->ID ]['author']; 806 $reason = $revision_log[ $revision->ID ]['reason']; 807 807 } 808 808 -
trunk/src/includes/topics/functions.php
r5893 r5908 3235 3235 foreach ( (array) $stickies as $key => $id ) { 3236 3236 if ( ! bbp_is_topic( $id ) ) { 3237 unset( $stickies[ $key] );3237 unset( $stickies[ $key ] ); 3238 3238 } 3239 3239 } -
trunk/src/includes/users/capabilities.php
r5834 r5908 365 365 366 366 // Use a mapped role 367 if ( isset( $role_map[ $user_role] ) ) {368 $new_role = $role_map[ $user_role];367 if ( isset( $role_map[ $user_role ] ) ) { 368 $new_role = $role_map[ $user_role ]; 369 369 370 370 // Use the default role … … 385 385 // Don't add the user, but still give them the correct caps dynamically 386 386 } else { 387 $bbp->current_user->caps[ $new_role] = true;387 $bbp->current_user->caps[ $new_role ] = true; 388 388 $bbp->current_user->get_role_caps(); 389 389 } -
trunk/src/includes/users/functions.php
r5888 r5908 105 105 106 106 if ( ! empty( $key ) && in_array( $key, array_keys( $cookie_names ) ) ) { 107 return $bbp_current_poster[ $cookie_names[$key]];107 return $bbp_current_poster[ $cookie_names[ $key ] ]; 108 108 } 109 109 -
trunk/src/includes/users/options.php
r5770 r5908 116 116 117 117 // Check the options global for preset value 118 if ( isset( $user->ID ) && isset( $bbp->user_options[ $user->ID] ) && ! empty( $bbp->user_options[$user->ID][$option] ) ) {119 $value = $bbp->user_options[ $user->ID][$option];118 if ( isset( $user->ID ) && isset( $bbp->user_options[ $user->ID ] ) && ! empty( $bbp->user_options[ $user->ID ][ $option ] ) ) { 119 $value = $bbp->user_options[ $user->ID ][ $option ]; 120 120 } 121 121
Note: See TracChangeset
for help on using the changeset viewer.