Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,471 through 1,485 (of 3,958 total)
  • Author
    Posts
  • in reply to: Change Destination Of Custom File Upload Field Type #13156
    Anh TranAnh Tran
    Keymaster

    Hi Lucjan,

    We've just finished the feature and the code is available on Github. Please download and try it.

    In a couple of days, I'll release a new version of Meta Box and write a tutorial about that.

    To upload to custom folder, please use file field and set a new attribute upload_dir to the path of the new folder, like this:

    array(
        'type' => 'file',
        'id' => 'f',
        'name' => 'File',
        'upload_dir' => '/path/to/your/folder/', // You can use ABSPATH . '/downloads/'
    )
    in reply to: Button's std isn't displaying #13155
    Anh TranAnh Tran
    Keymaster

    Hi Axel,

    I've just tried creating a Button with the Builder and set the Button text as follows:

    https://screenshots.firefox.com/MOAClmMZnWO3MiAf/localhost

    And here is how it looks when editing a post:

    https://screenshots.firefox.com/GtG8A0pa2aleAgR5/localhost

    Can you please try again?

    in reply to: Customizer Settings #13154
    Anh TranAnh Tran
    Keymaster

    Hi Mark,

    1) I started to do an extension for the Customizer 2 years ago. But the more developing, the more I realized that I had to rewrite the whole plugin to port it to JavaScript. So, I stopped. At the moment, the MB Settings Page only supports back end pages, not in the Customizer.

    2) To make it compatible with Customizer, you need to set 'option_name' => "theme_mods_$themeslug" in your settings page. Then the MB Settings Page will save data into theme mods, which are used by the Customizer.

    in reply to: Registration Form Not Showing Anything #13153
    Anh TranAnh Tran
    Keymaster

    Hi Clayton,

    It's a bug in the AIO package. I'll update it tomorrow. At the moment, please use the MB User Profile extension separately.

    in reply to: GeoSpatial queries #13134
    Anh TranAnh Tran
    Keymaster

    Hi David,

    No, the plugin use $wpdb directly to add/update the data. Please use this:

    global $wpdb;
    $data = [
        'ID'      => $post_id,
        'field_1' => 'value_1',
        'field_2' => 'value_2',
    ];
    $wpdb->insert( 'your_table', $data );
    in reply to: How to edit Email and Password #13133
    Anh TranAnh Tran
    Keymaster

    Hi Purdue, this is a bug in our AIO plugin. Are you using it?

    To fix this, please use the MB User Profile extension separately at the moment. We'll fix the AIO soon.

    in reply to: Function to get all fields of a specific Meta Box #13125
    Anh TranAnh Tran
    Keymaster

    Please use this function:

    $meta_box = rwmb_get_registry( 'meta_box' )->get( 'YOUR_META_BOX_ID' );
    $fields = $meta_box->fields;
    in reply to: Registration Form Not Showing Anything #13124
    Anh TranAnh Tran
    Keymaster

    Hi @swartjie, I tried to replied your contact message, but your email was incorrect. I wanted to send you the updated version for testing before updating AIO. I've just sent via FB Messenger, can you please check?

    @Clayton: Let me check that. Thanks for letting me know.

    in reply to: Registration Form Not Showing Anything #13119
    Anh TranAnh Tran
    Keymaster

    Hi, thanks a lot for your feedback and debug. I'll check the bundled version in AIO and fix it asap.

    in reply to: Cannot create user with empty ID #13115
    Anh TranAnh Tran
    Keymaster

    Can you take some screenshots and/or videos? I have no clue why it shows the message :(. Here is the guide to take screenshots and videos.

    in reply to: rwmb_after_save_post #13100
    Anh TranAnh Tran
    Keymaster

    Hmm, couldn't find anywhere the JSON value is stored.

    However, I found something confusing in your code:

    This part:

    if( is_string($field['value']) && is_array(json_decode($field['value'], true)) ) {
            $array = json_decode( $field['value'] );
            $i = 0;
            foreach( $array as $value) {
              update_post_meta($post_id, '_property_' . $new_level . '_' . $field['key'], $value[$i]);
              $i++;
            }
          } else {...}

    Here you check if $field['value'] is a json-string. But when you decode it with $array = json_decode( $field['value'] );, then $array will be an object! Not sure why the next foreach loop work.

    in reply to: Cannot create user with empty ID #13099
    Anh TranAnh Tran
    Keymaster

    Hi Kevin,

    I've just checked and don't see the message. Have you updated to the latest version?

    Also can you check if your meta box contains any field with ID email? This field coincide with WP user field and might trigger the create user action (it doesn't trigger in my test, but maybe in yours).

    in reply to: Sort group array value to rank #13098
    Anh TranAnh Tran
    Keymaster

    Hi Arif,

    This is more related to sorting values in PHP rather than with Meta Box. I'll try to give you the concept of doing that, please follow it. Your logic is complicated and I couldn't provide full code for you.

    As I see you store all teams and their info in a group field goalkick_league_point_table_option, right? And for each team, you record the number of matches that the team won or lost, right? (I assume that, cause I don't know if that's the number of matches or number of scores for matches).

    To sort teams, we will need to use usort() function.

    Here is my first idea for sorting by scores:

    function get_score( $team_details ) {
        $win = isset( $team_details['goalkick_league_standing_match_win_manual'] ) ? $team_details['goalkick_league_standing_match_win_manual'] : 0;
        $lost = isset( $team_details['goalkick_league_standing_match_win_manual'] ) ? $team_details['goalkick_league_standing_match_loss_manual'] : 0;
        return $win * 3;
    }
    
    $teams = rwmb_meta( 'goalkick_league_point_table_option' );
    usort( $teams, function( $a, $b ) {
        $a_score = get_score( $a );
        $b_score = get_score( $b );
        
        if ( $a_score == $b_score ) {
            return 0;
        }
        return $a_score > $b_score ? -1 : 1;
    } );

    If you want to check by other conditions (2 and 3), then in the callback function of usort, add more conditions, like this:

    usort( $teams, function( $a, $b ) {
        $a_score = get_score( $a );
        $b_score = get_score( $b );
        
        // Scores equal, sort by matches played.
        if ( $a_score == $b_score ) {
            $a_matches = get_matches( $a );
            $b_matches = get_matches( $b );
    
            // If matches equal, sort by something else.
            if ( $a_matches == $b_matches ) {
            }
    
            return $a_matches > $b_matches ? -1 : 1;
        }
        return $a_score > $b_score ? -1 : 1;
    } );
    in reply to: Default Fields Suddenly Stopped Showing #13097
    Anh TranAnh Tran
    Keymaster

    Hi Jay,

    In a recent update, the default fields (username and password) was removed from the profile field. It's requested by some users. To re-add them, please add id="rwmb-user-info" to the shortcode. For details, please see the docs.

    in reply to: Quick Links - My Topics link is broken #13086
    Anh TranAnh Tran
    Keymaster

    It's fixed. Thanks for your feedback!

Viewing 15 posts - 1,471 through 1,485 (of 3,958 total)