Forum Replies Created

Viewing 15 replies - 1 through 15 (of 47 total)
  • Plugin Author mirceatm

    (@mirceatm)

    Hi, I suppose you have your Strava client id and secret configured in the Admin + used the short-code

    [strava_nmr]

    to register on your site and allow your Strava activities to be read?

    You can add a manual run record in Strava and it should reach your website if all is good. Delete from Strava should also work.

    There’s some logs stored in a table [wordpress_prefix]nmr_strava_logs – if you can take a look maybe there’s hints of what’s wrong

    Plugin Author mirceatm

    (@mirceatm)

    Hi,

    It’s possible to rename the file that has been uploaded (as listed in the plugin description) by listening and reacting to filter nmr_create_attachment_file_name – the problem seems to be: how to get the new file name, as this is supposed to be another CF7 field called ‘Name’ – and for this problem, CF7 forum has answers.

    Here is some not-tested code:

    // This is called before the attachment is saved, we can change the filename here
    function example_callback( $file_name ) {
    // Get the WPCF7_Submission object
    $submission = WPCF7_Submission::get_instance();
    // Get the new file name from the 'Name' field value
    $new_filename = $submission->get_posted_data( 'Name' );
    return $new_filename;
    }
    add_filter( 'nmr_create_attachment_file_name', 'example_callback', 10, 1 )
    Plugin Author mirceatm

    (@mirceatm)

    Hi,

    Since you already get the message: Connected to Strava, all is good!

    It is ok to get an error message if you refresh the page (but refreshing the page should not be performed, there is no need to) – the important thing is that it says: Connected to Strava.

    My test page looks like this:

    <!-- wp:shortcode -->
    [strava_nmr_table top=11]
    <!-- /wp:shortcode -->

    <!-- wp:shortcode -->
    [strava_nmr top="11"]
    <!-- /wp:shortcode -->

    First shortcode should list all new activities received since the plugin connected to Strava. Note that only new activities will reach your web-site, meaning this plugin is not importing old, existing Strava activities (only new ones – even if you add a new Manual Activity. Try with Run activity)

    Plugin Author mirceatm

    (@mirceatm)

    Hi,

    I’m sorry for responding this late.

    Where do you see “Invalid state”? Is it at “Plugin status”?

    Verify token is required by Strava – is should be a ‘random’ string – in my experience any string will work, event the default one proposed by the plugin: ‘nmr-verify-strava-token’ so use this one.

    Plugin Author mirceatm

    (@mirceatm)

    You can use the following code to jump start your own solution:

    add_filter('wpcf7_mail_tag_replaced_file',
    function ($replaced, $submitted, $html, $mail_tag) {
    $submission = WPCF7_Submission::get_instance();
    $uploaded_files = $submission->uploaded_files();
    $name = $mail_tag->field_name();
    if ( ! empty( $uploaded_files[$name] ) ) {
    $paths = (array) $uploaded_files[$name];
    foreach($paths as $key => $value){
    $baseValue = wp_basename($value);
    $paths[$key] = '<a href="https://your-website/upload-path/' . $baseValue . '">' . $baseValue . '</a>';
    }

    $replaced = wpcf7_flat_join( $paths, array(
    'separator' => ', ',
    ) );
    }
    return $replaced;
    }, 11, 4);

    This listens to email composing for file (note you might need the same for file*), gets the file, builds an HTML anchor tag with a hard coded value (change it to your website) that will be included in the email.

    Have fun!

    Plugin Author mirceatm

    (@mirceatm)

    Hi, while this is a really interesting question note that it is not related to this plugin.

    According to the CF7 documentation, using the [file] mail-tag for file uploading field: will send the file name and it will attach the file to the email. It’s my understanding you want to send the file link where it’s stored on your web-site and you do not want to have it attached to the email.

    My 2 cents: consider extending CF7 with a new form-tag field similar to original [file] where you overwrite the place where the value is returned (meaning the file name is replaced with the file location on the web server) to the method that sends the email in CF7 and maybe some other parts such that no file will actually be attached to the email.

    Plugin Author mirceatm

    (@mirceatm)

    Hi, in the new version 1.2.3 there is a filter called nmr_should_skip_save_attachment_to_media_library

    Return true to skip saving to Media Library like below:

    add_filter( 'nmr_should_skip_save_attachment_to_media_library', 
    function ($skip_save_to_media_library){
    return true;
    }, 10, 1 );
    Plugin Author mirceatm

    (@mirceatm)

    Hi, version 1.0.8 allows changes to month and year.

    Good luck, Mircea.

    Plugin Author mirceatm

    (@mirceatm)

    Hi, yes it is!

    Plugin Author mirceatm

    (@mirceatm)

    Hi,

    Indeed, the message: The field is required. didn’t show. This should be working now, in version 1.0.7

    Good luck and thanks for bringing this up!

    Plugin Author mirceatm

    (@mirceatm)

    Hi!

    You can try datepicker plus

    It has support to exclude individual dates or date intervals:

    [datepickerplus myFirstDatepicker id:myFirstDatepicker format:dd.mm.yy min:2023-02-06 max:2023-03-08 nmrexclude:2023-02-26|2023-02-20_2023-02-24]
    • This reply was modified 1 year, 9 months ago by mirceatm.
    Plugin Author mirceatm

    (@mirceatm)

    Hi!

    Please try using min and max For instance:

    [datepicker* myFirstDatepicker id:myFirstDatepicker format:dd.mm.yy min:2022-06-06 max:2022-08-08 placeholder:"day.month.year"] 
    Plugin Author mirceatm

    (@mirceatm)

    Hello!
    Answering this is a bit out of scope of this plugin and this thread.
    Here is a ‘quick and dirty’ untested solution:
    – edit a file called functions.php on your active theme
    – add code:

    function on_nmr_create_attachment_file_name($filename)
    {
    $path_parts?=?pathinfo($filename); //get details about file name
    //make sure that file name is unique and return it.
    return wp_unique_filename($path_parts[‘dirname’], $path_parts[‘filename’]);
    }
    add_filter(‘nmr_create_attachment_file_name’, ‘on_nmr_create_attachment_file_name’);

    • This reply was modified 1 year, 12 months ago by mirceatm.
    • This reply was modified 1 year, 12 months ago by mirceatm.
    Plugin Author mirceatm

    (@mirceatm)

    It works, at least the first time you load the page.
    For instance:

    
    [datepicker* myFirstDatepicker id:myFirstDatepicker format:dd.mm.yy min:2022-06-06 max:2022-08-08 placeholder:"day.month.year"] 
    
    Plugin Author mirceatm

    (@mirceatm)

    Hi,
    Currently, this plugin stores the file uploaded with CF7 in media library and is able to output the url to it.
    To get the url of the stored file listed in the email sent by CF7, one could try to write code that customizes ContactForm7 email as documented here
    Drop a line if you have trouble figuring that out.

Viewing 15 replies - 1 through 15 (of 47 total)