Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 54 total)
  • Author
    Posts
  • in reply to: How to save image data using custom tables? #14875
    proyectohappyweb@gmail.com[email protected]
    Participant

    Hello, I think, related with this post:
    I save in the custom table of users named "usuarios", a avatar image of this user:

    $meta_boxes[] = array(
        //'title' => 'Custom avatar',
        'id'        => 'avatar',
            'type'  => 'user', // Specifically for user
        'storage_type'  => 'custom_table',    // Important
            'table'         => 'usuarios', // Your custom table name 
            'fields' => array(
            array(
                'name'            => 'Subir/Upload Avatar',
                'id'              => 'avatar',
                'type'            => 'image_advanced',
                'max_file_uploads' => 1,
            ),
        ),
    );
    

    The value of the image saved is: a:2:{i:0;s:0:"";i:1;i:734;}

    It's ok? Or I have to make the econding? How can I make this encoding?

    To get the image in a post, I have to make this function:

    1.- First I get the row of the user in $r
    2.- Take the value of the image: $resultado = $r['avatar'];
    3.- $resultado = 'img src="'.$r['avatar'].'" /> '; // don't put here the initial < because don't show the code the post...

    But this don't run, don't know how to save and get the image to show in frontend...

    In the documentation: https://docs.metabox.io/fields/image-advanced/

    $images = rwmb_meta( 'info', array( 'limit' => 1 ) ); --> I modify the field 'info' for my image field: $r['avatar']
    $image = reset( $images );
    $izquierda .= '<img src="'.$image['url'].'" />';

    But don't run...

    Can you help me please?

    Thanks,
    Sergio

    in reply to: Show MB Relationships field in Frontend Submission #14862
    proyectohappyweb@gmail.com[email protected]
    Participant

    oh perfect!! Thanks!!

    in reply to: Result searches google maps #14851
    proyectohappyweb@gmail.com[email protected]
    Participant

    oh yes, it's no activated geolocation extension... Sorry!!

    Thanks.

    in reply to: Open Street Map: View all post of one cpt #14799
    proyectohappyweb@gmail.com[email protected]
    Participant

    Oh, it works well for me, forget my previous message. Thank you!!

    in reply to: Open Street Map: View all post of one cpt #14790
    proyectohappyweb@gmail.com[email protected]
    Participant

    Hello, many thanks!!

    Questions... I don't want to use a new page to insert the map... I want to put the map in the top of each archive pages of each cpt.
    To do that:
    1.- I have to put his line in my archive page?

    2.- I have to update something in the wp_enqueue_script function in functions.php ?

    3.- I have to modify something in the list.js ?

    4.- I have to put the list.js in my js folder?
    In my theme is here: .../wp-content/themes/theme-name/assets/js/
    In functions.php I have to update this code?
    wp_enqueue_script( 'list', get_parent_theme_file_uri( 'js/list.js' ), ['jquery', 'leaflet'], '1.0', true );
    to
    wp_enqueue_script( 'list', get_parent_theme_file_uri( 'js/assets/list.js' ), ['jquery', 'leaflet'], '1.0', true );

    Many thanks for your help.
    Sergio

    in reply to: Open Street Map: View all post of one cpt #14775
    proyectohappyweb@gmail.com[email protected]
    Participant

    Hello, you finally wrote the tutorial?

    Thanks,
    Sergio

    in reply to: Create terms taxonomy field #14511
    proyectohappyweb@gmail.com[email protected]
    Participant

    Thanks for your update in the 4.18 version, to can create new taxonomies with the parameters 'add_new' => true.

    Can you hide this parameter? That only can create taxonomies for certain users or certain conditions?

    Thanks,
    Sergio

    proyectohappyweb@gmail.com[email protected]
    Participant

    Ah ok, I wanted to put both, with a radio field, to hide one of the two maps, and that the user could choose to create a business with Google Maps or open a street map ... But I see that I will have to think of another solution ...

    Thanks.

    in reply to: Open Street Map: available fields #14393
    proyectohappyweb@gmail.com[email protected]
    Participant

    Perfect, I will be pending for future news. Thank you!!

    proyectohappyweb@gmail.com[email protected]
    Participant

    Hello,

    This second method, Set the rule for the whole meta box B, don't do nothing for me, not run in front office... In the back office it run well.

    To run well in the front office I have to do the option 1, Set the rule for each field in the meta box.

    Don't know if the problem is only for me...

    Thanks

    proyectohappyweb@gmail.com[email protected]
    Participant

    Perfect!! Many thanks!!

    proyectohappyweb@gmail.com[email protected]
    Participant

    Hello,

    I try this:
    'readonly' => true,
    and it run ok!! Users can't edit the field and the value is saved in the custom table.

    Sergio

    proyectohappyweb@gmail.com[email protected]
    Participant

    Hello,

    I have a proble using:
    'disabled' => !is_admin(), // This disables editing in the front end.

    With a meta box with:
    'storage_type' => 'custom_table', // Important

    Is that all fields are saved well in the custom table except the fields that I put 'disabled' => !is_admin()...

    Have you detected if it is a general error? Or does it just happen to me?

    I try to put this like this
    'attributes' => array(
    'disabled' => true,
    ),
    But it doesn't matter, not save the value...

    Thanks.

    proyectohappyweb@gmail.com[email protected]
    Participant

    Oh, thanks, I understand.

    So I do not know if it can be done or if in this forum you could guide me for the following:
    To obtain in the results of the select_advanced the users of a custom table related to the users according to a condition that occurs on a field saved in the custom table itself.

    Thanks

    proyectohappyweb@gmail.com[email protected]
    Participant

    What a good solution, I loved it, much easier to manage and with many fewer lines of code.

    Thank you.

Viewing 15 posts - 16 through 30 (of 54 total)