Support » Plugin: Contact Form DB » filter form by user profile?

  • Have this plugin and also Cimy User Extra Fields, i have created a field in cimy user extra fields called ANINO this is unique for each user, Then using results form race results are added to db, i want to create a table which shows all results for that user and only that user.

    The results table has fields name, anino, distance, date, time, position
    if possible can i also only show smallest result for each distance?

    eg user A has results
    Dist HM
    Time 1:23:23
    Dist 10K
    Time 0:54:12
    Dist HM
    Time 1:31:14
    i would only see HM 1:23:23 10K 0:54:12
    filtering by ANI would do but by smallest time would be bonus. Please help

    https://wordpress.org/plugins/contact-form-7-to-database-extension/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    To find the min for a user in principal, you could use:
    [cfdb-value form="myform" filter="Submitted Login=$user_login" show="field-with-time"]

    *BUT* it looks like your times are not simple numbers. They are like “1:31:14” which cfdb-value will not know how to process. So you would have to write your own custom short code.

    See:

    Thread Starter cobrien64

    (@cobrien64)

    Hi Michael,
    Thanks but the main issue is not with time but with creating the short code to filter by anino.
    I know that this code below should return value of
    $value = get_cimyFieldValue(user_id, ANINO);
    but how do I incorporate it in shortcode

    Plugin Author Michael Simpson

    (@msimpson)

    You would have to build your own short code to be able to apply the get_cimyFieldValue function.

    Thread Starter cobrien64

    (@cobrien64)

    I have tried this but returns no results.

    [cfdb-table form=”2014 Results Entry” show=”Firstname,LastName,ANINO,Distance,Race Name,Time” role=”Anyone” filter=”ANINO=get_cimyFieldValue(user_id, ANINO);” ASC”]

    Can someone please tell me where I am going wrong.

    Plugin Author Michael Simpson

    (@msimpson)

    It will not recognize get_cimyFieldValue(user_id, ANINO) as a function to call it. It is looking for an entry in ANINO where the text literally is “get_cimyFieldValue(user_id, ANINO);”

    Thread Starter cobrien64

    (@cobrien64)

    so how do i get it to compare the field in the form with the field in the user profile? I assume you will refer me to earlier post re short codes but i’m struggling with that so any help would be appreciated.

    Thread Starter cobrien64

    (@cobrien64)

    new to all this creating short codes etc, I am using cimy user extra fields to create a field in user profile called anino, I want to use the vaule of this field in a shortcode in cfdb, to filter table results, but I am unsure how to do comparison?
    $value = get_cimyFieldValue(user_id, field_name);

    Plugin Author Michael Simpson

    (@msimpson)

    I’ll look into what it would take to add code to support this. No promises.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘filter form by user profile?’ is closed to new replies.